GetCities

Endpoint

Overview

The "GetCities" endpoint is a GET request. It is used to retrieve a list of cities that belong to a certain county. Also, you can search for a specific city name in a certain country. Detailed functionality of how to use this endpoint is explained in the Shipping section.

The endpoint on Swagger is: Shipping_GetCities.

Now, we are going to declare the endpoint and its models along with each accepted parameter and possible value.

📘

Request Header

Add "Authorization": "Bearer {Token}" to request header. Token of demo configuration can be found here.


Request Model

The request is a GET request with the following parameters:

Input ParameterTypeDescription
shippingMethodinteger1 for DHL
2 for ARAMEX
countryCodestringThe country code retrieved from the GetCountries endpoint.
searchValuestring, optionalThe search key that will filter the cities by names

Response Model

After viewing the Response Model that you will get as a result of your request, here, you will find full details about the Data Model of this API endpoint. Let's check it and its contents.

Response FieldTypeDescription
CountryCode stringThe country code of the retrieved cities.
CityNames Array of stringsList of cities names provided for the specified shipping method.

Sample Message

/v2/Getcities?shippingMethod=1&countryCode=ae&searchValue=ABU
{
  "IsSuccess": true,
  "Message": null,
  "FieldsErrors": null,
  "Data": {
    "CountryCode": "AE",
    "CityNames": [
      "ABU DHABI",
      "ABU DHABI CITY",
      "ABU HAIL, DUBAI",
      "AL MARKAZ IND. PARK ABU DHABI",
      "BADA ZAYED, ABU DHABI",
      "BARAKA, ABU DHABI",
      "GHAYATHI, ABU DHABI",
      "GHUWAIFAT, ABU DHABI",
      "HAMIM, ABU DHABI",
      "JEBEL DHANNA, ABU DHABI",
      "MIRFA, ABU DHABI",
      "RUWAIS, ABU DHABI",
      "SILA, ABU DHABI",
      "SWEIHAN, ABU DHABI",
      "TARIF, ABU DHABI"
    ]
  }
}