Get Cities

Description

Returns a list of cities. Maximum page size is 1000. Default page size is 1000.

Request

HTTP Method: GET

URI Path: /v3/cities

URI Query Parameters:

Name

Type

Is Required?

Description

filter[<filter_name>]

string, boolean

No

Filtering

include

string

No

Inclusion

sort

string

No

Sorting

Includes:

Value

Description

country

Country Object

region

Region Object

area

Area Object

Filters:

Filter Name

Type

Allow Blank

Allow Array

Filters by:

id

string

No

Yes

City id field.

name

string

Yes

Yes

City name field. Case insensitive.

country.id

string

Yes

Yes

A country.id field.

region.id

string

Yes

Yes

A region.id field.

is_available

boolean

No

No

Indicates if DID numbers in the specified city are currently available for purchase

area.id

string

Yes

Yes

A area.id field.

Sorting:

Value

Sort by

name

City name field.

Fielding:

Value

Returns

name

City name attribute.

Examples

http

GET /v3/cities HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API Token]

curl

curl -i -X GET https://api.didww.com/v3/cities -H "Accept: application/vnd.api+json" -H "Api-Key: [API Token]" -H "Content-Type: application/vnd.api+json"

response

HTTP/2 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "id": "dccb89ba-f777-4128-b99b-b25e19ccf4ea",
      "type": "cities",
      "attributes": {
        "name": "Aachen"
      },
      "relationships": {
        "country": {
          "links": {
            "self": "https://api.didww.com/v3/cities/dccb89ba-f777-4128-b99b-b25e19ccf4ea/relationships/country",
            "related": "https://api.didww.com/v3/cities/dccb89ba-f777-4128-b99b-b25e19ccf4ea/country"
          }
        },
        "region": {
          "links": {
            "self": "https://api.didww.com/v3/cities/dccb89ba-f777-4128-b99b-b25e19ccf4ea/relationships/region",
            "related": "https://api.didww.com/v3/cities/dccb89ba-f777-4128-b99b-b25e19ccf4ea/region"
          }
        },
        "area": {
          "links": {
            "self": "https://api.didww.com/v3/cities/dccb89ba-f777-4128-b99b-b25e19ccf4ea/relationships/area",
            "related": "https://api.didww.com/v3/cities/dccb89ba-f777-4128-b99b-b25e19ccf4ea/area"
          }
        }
      }
    }
  ]
}

Other Responses

Code

Success

Description

404

No

Not Found

401

No

Unauthorized