Get City#
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 identifier of the City. |
include |
|
No |
Includes#
Value |
Description |
|---|---|
country |
|
region |
|
area |
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 "area": {
25 "links": {
26 "self": "https://api.didww.com/v3/cities/cdf449bc-e3fb-42cc-bf31-b88f91e40de4/relationships/area",
27 "related": "https://api.didww.com/v3/cities/cdf449bc-e3fb-42cc-bf31-b88f91e40de4/area"
28 }
29 }
30 }
31 }
32}
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 "area": {
29 "links": {
30 "self": "https://api.didww.com/v3/cities/498f2880-591f-436d-aacd-46ad3a7d8be8/relationships/area",
31 "related": "https://api.didww.com/v3/cities/498f2880-591f-436d-aacd-46ad3a7d8be8/area"
32 }
33 }
34 }
35 },
36 "included": [
37 {
38 "id": "2e89d524-55b6-4b6c-a0af-3c1ed0f407f9",
39 "type": "countries",
40 "attributes": {
41 "name": "United Kingdom",
42 "prefix": "44",
43 "iso": "GB"
44 }
45 }
46 ]
47}
Other Responses#
Code |
Success |
Description |
|---|---|---|
404 |
No |
|
401 |
No |