# GetCityList

This API returns information about different destinations. If you set "IncludeSubCity = false", you will only receive a list of regions with the type "Destination". However, if you set "IncludeSubCity = true", you can receive a list of regions with the type "City", as well as the type "Destination". Generally, the scope of a city destination is encompassed within the larger scope of the destination type.

POST
https://apiint.didatravel.com/api/staticdata/GetCityList?$format=json
In the following example, the code parameters inside are modifiable.
Use the following method to test API:
{
    "IncludeSubCity": false,
    "Header": {
        "LicenseKey": "TestKey",
        "ClientID": "DidaApiTestID"
    },
    "CountryCode": "CN"
}
In the following example, the code parameters inside are modifiable.
Use the following method to test API:
<GetCityListRQ>
  <Header>
    <ClientID>DidaApiTestID</ClientID>
    <LicenseKey>TestKey</LicenseKey>
  </Header>
  <CountryCode>CN</CountryCode>
  <IncludeSubCity>false</IncludeSubCity>
</GetCityListRQ>
   {
        "name": "Header",
        "description": "Client authentication info",
        "children": [
            {
                "name": "ClientID",
                "description": "Client ID",
            },
            {
                "name": "LicenseKey",
                "description": "Client password",
            }
        ]
    },
    {
        "name": "CountryCode",
        "description": "ISO 3166-1 alpha-2, two-letter region codes. CN, US for example.",
    },
    {
        "name": "IncludeSubCity",
        "description": "IncludeSubCity = false, you can only get region type=Destination list; IncludeSubCity = true, you can get region type=City/Destination list.",
    },
    {
        "name": "IncludeSubCitySpecified",
        "description": "",
    }
Request Parameters
Header HeaderType
Client authentication infoHeaderType
CountryCode String ISO 3166-1 alpha-2, two-letter region codes. CN, US for example.String
IncludeSubCity Boolean IncludeSubCity = false, you can only get region type=Destination list; IncludeSubCity = true, you can get region type=City/Destination list.Boolean
Request Sample
{
    "IncludeSubCity": false,
    "CountryCode": "CN",
    "Header": {
        "LicenseKey": "TestKey",
        "ClientID": "DidaApiTestID"
    }
}
Request Sample
<GetCityListRQ>
  <Header>
    <ClientID>DidaApiTestID</ClientID>
    <LicenseKey>TestKey</LicenseKey>
  </Header>
  <CountryCode>CN</CountryCode>
  <IncludeSubCity>false</IncludeSubCity>
</GetCityListRQ>
    {
        "name": "Error",
        "description": "",
        "children": [
            {
                "name": "Code",
                "description": "Error code",
            },
            {
                "name": "Message",
                "description": "Error message",
            }
        ]
    },
    {
        "name": "Success",
        "description": "",
        "children": [
            {
                "name": "Cities",
                "description": "City information Collection",
                "children": [
                    {
                        "name": "CountryCode",
                        "description": "ISO 3166-1 alpha-2, two-letter region codes. CN, US for example.",
                    },
                    {
                        "name": "CityCode",
                        "description": "Region code. Bad naming long time ago.",
                    },
                    {
                        "name": "CityName",
                        "description": "Region name",
                    },
                    {
                        "name": "CityLongName",
                        "description": "Region long name",
                    },
                    {
                        "name": "CityName_CN",
                        "description": "Region name in Chinese",
                    },
                    {
                        "name": "CityLongName_CN",
                        "description": "Region long name in Chinese",
                    },
                    {
                        "name": "ParentCityCode",
                        "description": "If a region&#39;s type = City, it&#39;s ParentCityCode will point to a type=Destination region.",
                    },
                    {
                        "name": "Type",
                        "description": "City or Destination",
                    }
                ]
            }
        ]
    }
Response Parameters
Error ErrorType
ErrorType
Success GetCityListRSSuccess
GetCityListRSSuccess
Response Sample
{
    "Success": {
        "Cities": [
            {
                "CityLongName_CN": "阿勒泰, 中国",
                "CityName_CN": "阿勒泰",
                "CityLongName": "Altay, China",
                "CityName": "Altay",
                "CityCode": "260",
                "CountryCode": "CN"
            },
            {
                "CityLongName_CN": "阿克苏, 中国",
                "CityName_CN": "阿克苏",
                "CityLongName": "Aksu, China",
                "CityName": "Aksu",
                "CityCode": "351",
                "CountryCode": "CN"
            }
        ]
    }
}
Response Sample
<?xml version="1.0"?>
<GetCityListRS>
  <Success>
    <Cities>
      <City>
        <CountryCode>CN</CountryCode>
        <CityCode>260</CityCode>
        <CityName>Altay</CityName>
        <CityLongName>Altay, China</CityLongName>
        <CityName_CN>阿勒泰</CityName_CN>
        <CityLongName_CN>阿勒泰, 中国</CityLongName_CN>
      </City>
      <City>
        <CountryCode>CN</CountryCode>
        <CityCode>351</CityCode>
        <CityName>Aksu</CityName>
        <CityLongName>Aksu, China</CityLongName>
        <CityName_CN>阿克苏</CityName_CN>
        <CityLongName_CN>阿克苏, 中国</CityLongName_CN>
      </City>
    </Cities>
  </Success>
</GetCityListRS>