Get City#
Description
Returns a city for a given city ID number. Note that a unique identification number is allocated to each city included in the DIDWW coverage.
Request#
HTTP Method: GET
URI Path: /v3/cities/
URI Query Parameters:
Name |
Type |
Is Required? |
Description |
|---|---|---|---|
id |
|
Yes |
Unique ID number for the city |
include |
|
Optional |
Includes:
Value |
Description |
|---|---|
country |
|
region |
Examples#
http
1GET /v3/cities/cdf449bc-e3fb-42cc-bf31-b88f91e40de4 HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API Token]
curl
1curl -i -X GET https://api.didww.com/v3/cities/cdf449bc-e3fb-42cc-bf31-b88f91e40de4 -H "Accept: application/vnd.api+json" -H "Api-Key: [API Token]" -H "Content-Type: application/vnd.api+json"
response
1HTTP/1.1 200 OK
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "cdf449bc-e3fb-42cc-bf31-b88f91e40de4",
7 "type": "cities",
8 "attributes": {
9 "name": "London"
10 },
11 "relationships": {
12 "country": {
13 "links": {
14 "self": "https://api.didww.com/v3/cities/cdf449bc-e3fb-42cc-bf31-b88f91e40de4/relationships/country",
15 "related": "https://api.didww.com/v3/cities/cdf449bc-e3fb-42cc-bf31-b88f91e40de4/country"
16 }
17 },
18 "region": {
19 "links": {
20 "self": "https://api.didww.com/v3/cities/cdf449bc-e3fb-42cc-bf31-b88f91e40de4/relationships/region",
21 "related": "https://api.didww.com/v3/cities/cdf449bc-e3fb-42cc-bf31-b88f91e40de4/country"
22 }
23 }
24 }
25 },
26 "meta": {
27 "api_version": "2017-09-18"
28 }
29}
http
1GET /v3/cities/498f2880-591f-436d-aacd-46ad3a7d8be8?include=country HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API Token]
curl
1curl -i -X GET 'https://api.didww.com/v3/cities/498f2880-591f-436d-aacd-46ad3a7d8be8?include=country' -H "Accept: application/vnd.api+json" -H "Api-Key: [API Token]" -H "Content-Type: application/vnd.api+json"
response
1HTTP/1.1 200 OK
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "498f2880-591f-436d-aacd-46ad3a7d8be8",
7 "type": "cities",
8 "attributes": {
9 "name": "London"
10 },
11 "relationships": {
12 "country": {
13 "links": {
14 "self": "https://api.didww.com/v3/cities/498f2880-591f-436d-aacd-46ad3a7d8be8/relationships/country",
15 "related": "https://api.didww.com/v3/cities/498f2880-591f-436d-aacd-46ad3a7d8be8/country"
16 },
17 "data": {
18 "type": "countries",
19 "id": "2e89d524-55b6-4b6c-a0af-3c1ed0f407f9"
20 }
21 },
22 "region": {
23 "links": {
24 "self": "https://api.didww.com/v3/cities/498f2880-591f-436d-aacd-46ad3a7d8be8/relationships/region",
25 "related": "https://api.didww.com/v3/cities/498f2880-591f-436d-aacd-46ad3a7d8be8/region"
26 }
27 }
28 }
29 },
30 "included": [
31 {
32 "id": "2e89d524-55b6-4b6c-a0af-3c1ed0f407f9",
33 "type": "countries",
34 "attributes": {
35 "name": "United Kingdom",
36 "prefix": "44",
37 "iso": "GB"
38 },
39 "relationships": {
40 "regions": {
41 "links": {
42 "self": "https://api.didww.com/v3/countries/2e89d524-55b6-4b6c-a0af-3c1ed0f407f9/relationships/regions",
43 "related": "https://api.didww.com/v3/countries/2e89d524-55b6-4b6c-a0af-3c1ed0f407f9/regions"
44 }
45 }
46 }
47 }
48 ],
49 "meta": {
50 "api_version": "2017-09-18"
51 }
52}
Other Responses#
Code |
Success |
Description |
|---|---|---|
404 |
No |
|
401 |
No |