# 城市数据

目的地信息。当 IncludeSubCity = false时,您只能获取区域类型 = 目的地列表;当 IncludeSubCity = true 时,您可以获取区域类型 = 城市和获取区域类型=目的地列表。一般来说,城市的目的地范围包含在目的地的范围内。

POST
https://api.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": "机构验证信息",
        "children": [
            {
                "name": "ClientID",
                "description": "机构账号"
            },
            {
                "name": "LicenseKey",
                "description": "机构账号密码"
            }
        ]
    },
    {
        "name": "CountryCode",
        "description": "ISO 3166-1 alpha-2, 2个字母的地区码. 例如 CN, US"
    },
    {
        "name": "IncludeSubCity",
        "description": "IncludeSubCity = false, 只会返回 region type=Destination 的列表; IncludeSubCity = true, 会返回 type=City/Destination 的列表."
    }
]
Request Parameters
Header HeaderType
机构验证信息HeaderType
CountryCode String ISO 3166-1 alpha-2, 2个字母的地区码. 例如 CN, USString
IncludeSubCity Boolean IncludeSubCity = false, 只会返回 region type=Destination 的列表; IncludeSubCity = true, 会返回 type=City/Destination 的列表.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": "地区信息集合",
                "children": [
                    {
                        "name": "CountryCode",
                        "description": "ISO 3166-1 alpha-2 2位的地区代码. 例如 CN, US"
                    },
                    {
                        "name": "CityCode",
                        "description": "地区代码"
                    },
                    {
                        "name": "CityName",
                        "description": "地区名"
                    },
                    {
                        "name": "CityLongName",
                        "description": "地区长名"
                    },
                    {
                        "name": "CityName_CN",
                        "description": "地区名 - 中文"
                    },
                    {
                        "name": "CityLongName_CN",
                        "description": "地区长名 - 中文"
                    },
                    {
                        "name": "ParentCityCode",
                        "description": "Type = City 的时候, 这个 ParentCityCode 会指向一个 Destination 类型的地区码"
                    },
                    {
                        "name": "Type",
                        "description": "类型,只会是 City 或 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>