Lấy danh sách thành phố, quận huyện

Request

Response

  • JSON decode the response to get the structure:

  • Nếu type = CITY

[
    {
      "id": 2, // int
      "name":  "Hà Nội" // string
    },
    {
      "id": 3,
      "name":  "Hồ Chí Minh"
    }
    // ...
]
  • Nếu type = DISTRICT

[
    {
      "id": 2, // int
      "parentId": 2, // int
      "name": "Quận Hoàn Kiếm" // string
    },
    {
      "id": 6,
      "parentId": 2,
      "name": "Quận Hai Bà Trưng"
    }
    // ...
]
  • Nếu type = WARD

[
    {
      "id": 2, // int
      "parentId": 3, // int
      "name": "Phường Bạch Đằng" // string
    },
    {
      "id": 6,
      "parentId": 3,
      "name": "Phường Bách Khoa"
    }
    // ...
]

Last updated