10. API to get the list of level 4 addresses
API to get the list of level 4 addresses (hamlets/villages/subdivisions) within a street/ward/commune. For some addresses, this information is mandatory and must be included in the order submission API.
Endpoint
GET /services/address/getAddressLevel4
Headers
- Token:
{API_TOKEN}
- X-Client-Source:
{PARTNER_CODE}
- Content-Type:
application/json
Sample Request
- HTTP
- CURL
- PHP
GET /services/address/getAddressLevel4?province=h%C3%A0%20n%E1%BB%99i&district=ba%20%C4%91%C3%ACnh&ward_street=%C4%91%E1%BB%99i%20c%E1%BA%A5n&address=20 HTTP/1.1
Token: {API_TOKEN}
X-Client-Source: {PARTNER_CODE}
curl -X GET -H "Token: {API_TOKEN}"\
-H "X-Client-Source: {PARTNER_CODE}"\
"{OPEN_API}/services/address/getAddressLevel4?province=h%C3%A0%20n%E1%BB%99i&district=ba%20%C4%91%C3%ACnh&ward_street=%C4%91%E1%BB%99i%20c%E1%BA%A5n&address=20"
<?php
$data = array(
"province" => "Hà nội",
"district" => "Quận Ba Đình",
"ward_street" => "Đội Cấn",
"address" => "",
);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://services.giaohangtietkiem.vn/services/address/getAddressLevel4?" . http_build_query($data),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_HTTPHEADER => array(
"Token: APITokenSample-ca441e70288cB0515F310742",
),
));
$response = curl_exec($curl);
curl_close($curl);
echo 'Response: ' . $response;
?>
Parameters
Parameter | Mandatory | Desc |
---|---|---|
address | no | String - A detailed address for which to retrieve a list of level 4 addresses, for example: đường Đội Cấn, Ba Đình, Hà Nội |
province | yes | String - The name of the province/city for which to retrieve the list of level 4 addresses. |
district | yes | String - The name of the district/ward for which to retrieve the list of level 4 addresses |
ward_street | yes | String - The name of the street/ward for which to retrieve the list of level 4 addresses. |
warning
Note: In cases where address
has a valid value, the province, district, etc., information of the pickup point will be retrieved based on this address code. The fields province
, district
, and ward_street
are not required to be sent.
Response
{
"success": true,
"data": [
"IIG - 75 Giang Văn Minh",
"Vinapaco Building - 142 Đội Cấn",
"THCS Thống Nhất",
"Ngõ 47 Đội Cấn",
"Ngõ 46 Đội Cấn"
]
}