The user address information and all address information in Thailand can be retrieved by postal code, province, district, and sub-district.
Address information of Thailand
The process of retrieving address information by postal code is a flow that requires the user to input their postal code, followed by the automatic population of their province, district, and sub-district details. This data can be retrieved by calling API Zip Code
curl --location --request GET 'https://buzzebees-dev.azure-api.net/api/address/main/postcode?zip_code=10400'
--header 'Content-Type: application/x-www-form-urlencoded; charset=utf-8'
--header 'Ocp-Apim-Subscription-Key: {Subscription-Key}'
--header 'Ocp-Apim-Trace: 1 '
--header 'App-Id: {App-Id} '
The resulting value will be a list of provinces and districts that correspond to the postal code that was used.
The obtained data must be organized into groups of provinces, districts, and sub-districts for use as options for districts and provinces, as shown in the example above.
Province list
The list of all provinces in Thailand can be fetched from API Get Province List.
curl --location --request GET 'https://buzzebees-dev.azure-api.net/api/address/main/province?'
--header 'Content-Type: application/x-www-form-urlencoded; charset=utf-8'
--header 'Ocp-Apim-Subscription-Key: {Subscription-Key}'
--header 'Ocp-Apim-Trace: 1 '
--header 'App-Id: {App-Id} '
After retrieving the data, it will be an array of each province, with province_code . It is the key to retrieve information.
District list
The list of all districts in specifically province. This can be called from API Get District List by passing a parameter province_code that obtained by calling API Get Province List.
curl --location --request GET 'https://buzzebees-dev.azure-api.net/api/address/main/district?province_code=10'
--header 'Content-Type: application/x-www-form-urlencoded; charset=utf-8'
--header 'Ocp-Apim-Subscription-Key: {Subscription-Key}'
--header 'Ocp-Apim-Trace: 1 '
--header 'App-Id: {App-Id} '
Subdistrict list
It refers to the data on all sub-districts within a province and district. This data can be accessed and further information viewed via the Get Subdistrict List, by sending the parameters of the province_code and district_code that are desired.
curl --location --request GET 'https://buzzebees-dev.azure-api.net/api/address/main/subdistrict?province_code=10&district_code=1030&'
--header 'Content-Type: application/x-www-form-urlencoded; charset=utf-8'
--header 'Ocp-Apim-Subscription-Key: {Subscription-Key}'
--header 'Ocp-Apim-Trace: 1 '
--header 'App-Id: {App-Id} '
Address list
The list of addresses belonging to users, as well as the addresses users select to use for prize delivery in campaigns that involve prize delivery, can be retrieved using the API Get Address List. This list can then be displayed as shown in the image.
curl --location --request GET 'https://buzzebees-dev.azure-api.net/api/address/profile/me/addresses?'
--header 'Content-Type: application/x-www-form-urlencoded; charset=utf-8'
--header 'Ocp-Apim-Subscription-Key: {Subscription-Key}'
--header 'Ocp-Apim-Trace: 1 '
--header 'App-Id: {app-id} '
--header 'Authorization: token {token}'
Add/Edit Address
Adding and updating user address information can be done by utilizing the API Add/Update Address, with parameters such as the zip code, province_code, district_ code, and sub-district_code. These codes can be retrieved from the API Zip Code
If you want to modify the existing data, pass the key in the parameter as well.
curl --location --request POST 'https://buzzebees-dev.azure-api.net/api/address/profile/me/address'
--header 'Content-Type: application/x-www-form-urlencoded; charset=utf-8'
--header 'Ocp-Apim-Subscription-Key: {Subscription-Key}'
--header 'Ocp-Apim-Trace: 1 '
--header 'App-Id: {app-id} '
--header 'Authorization: token {token}'
--form 'key=""'
--form 'addressname=""'
--form 'firstname=""'
--form 'lastname=""'
--form 'contact_number=""'
--form 'address=""'
--form 'zipcode=""'
--form 'province_name=""'
--form 'district_name=""'
--form 'subdistrict_name=""'
--form 'province_code=""'
--form 'district_code=""'
--form 'subdistrict_code=""'
--form 'isdefault="true"'
Address detail
Each individual address detail can obtaining from the API Get Address Detail.
curl --location --request GET 'https://buzzebees-dev.azure-api.net/api/address/profile/me/address?key={key}'
--header 'Content-Type: application/x-www-form-urlencoded; charset=utf-8'
--header 'Ocp-Apim-Subscription-Key: {Subscription-Key}'
--header 'Ocp-Apim-Trace: 1 '
--header 'App-Id: {app-id} '
--header 'Authorization: token {token}'
Deleting address
To delete each user's address data, the key must be sent to the API Delete Address.
curl --location --request DELETE 'https://buzzebees-dev.azure-api.net/api/address/profile/me/address?key={key}'
--header 'Content-Type: application/x-www-form-urlencoded; charset=utf-8'
--header 'Ocp-Apim-Subscription-Key: {Subscription-Key}'
--header 'Ocp-Apim-Trace: 1 '
--header 'App-Id: {app-id} '
--header 'Authorization: token {token}'
Tax Invoice address list
List of tax address that can be obtaining by call API Get Tax List.
curl --location --request GET 'https://buzzebees-dev.azure-api.net/api/address/profile/me/taxes?'
--header 'Content-Type: application/x-www-form-urlencoded; charset=utf-8'
--header 'Ocp-Apim-Subscription-Key: {Subscription-Key}'
--header 'Ocp-Apim-Trace: 1 '
--header 'App-Id: {app-id} '
--header 'Authorization: token {token}'
Add/Edit Tax Invoice Address
To add user tax invoice address information, the API Add/Update Tax Address List can be used. However, if any information needs to be modified, the key parameter needs to be sent along with the request.
curl --location --request POST 'https://buzzebees-dev.azure-api.net/api/address/profile/me/tax'
--header 'Content-Type: application/x-www-form-urlencoded; charset=utf-8'
--header 'Ocp-Apim-Subscription-Key: {Subscription-Key}'
--header 'Ocp-Apim-Trace: 1 '
--header 'App-Id: {app-id} '
--header 'Authorization: token {token}'
--form 'key=""'
--form 'addressname=""'
--form 'firstname=""'
--form 'lastname=""'
--form 'contact_number=""'
--form 'address=""'
--form 'zipcode=""'
--form 'province_name=""'
--form 'district_name=""'
--form 'subdistrict_name=""'
--form 'province_code=""'
--form 'district_code=""'
--form 'subdistrict_code=""'
--form 'isdefault=""'
--form 'isdefaulttax=""'
--form 'isTax=""'
--form 'taxid=""'
--form 'taxname=""'
Tax invoice details
Details of each user's tax invoice address can be retrieved using the API Get Tax Address.
curl --location --request GET 'https://buzzebees-dev.azure-api.net/api/address/profile/me/tax?key={key}'
--header 'Content-Type: application/x-www-form-urlencoded; charset=utf-8'
--header 'Ocp-Apim-Subscription-Key: {Subscription-Key}'
--header 'Ocp-Apim-Trace: 1 '
--header 'App-Id: {app-id} '
--header 'Authorization: token {token}'
Delete tax invoice address
To delete each user's tax invoice address data, the key must be sent to the API Delete Tax Address.
curl --location --request DELETE 'https://buzzebees-dev.azure-api.net/api/address/profile/me/tax?key={key}'
--header 'Content-Type: application/x-www-form-urlencoded; charset=utf-8'
--header 'Ocp-Apim-Subscription-Key: {Subscription-Key}'
--header 'Ocp-Apim-Trace: 1 '
--header 'App-Id: {app-id} '
--header 'Authorization: token {token}'