Get Subscribed Cities

Estimated reading: 3 minutes

The Get Cities API provides a list of available cities where VPN servers are located, tailored to the specific device requesting the information. This information is crucial for users to select their desired VPN server location.

Get Cities (v3)

  • URL: <base url>/inventory/v3/cities/<sDeviceType>
  • Request Method: POST

Use this API to get a complete list of subscribed Cities.

Returns a JSON object that contains the Cities.

Payload

KeyTypePass inDescription
X-AccessToken*StringHeaderaccessToken retrieved from Get Access Token endpoint
sDeviceType*StringPathType of device
Possible values: android | ios | mac | windows
(*) Required Parameter

Response

KeyTypeDescription
headerJSONJSON object that describes return code and message.
bodyJSONJSON object that returns cities array containing objects
citiesArrayArray of object that contains id, name, protocols and other details of the city

Sample Response

{
  "header": {
    "message": "success"
    "response_code": 1,
  },
  "body": {
    "cities": [{
      "id": 22,
      "name": "Toronto",
      "country_id": 43,
      "country": "CA",
      "is_freemium": false,
      "recommended_protocol": "IKEV",
      "latitude": 43.6535,
      "longitude": -79.3839,
      "data_centers": [],
      "protocols": [{
         "number": 8,
         "protocol": "TCP",
             "dns": [{
                  "configuration_version": "2.0",
                  "name": "cato2-auto-tcp.ptoserver.com"
                  "type": "primary",
                  "port_number": 80,
                  "is_multiport": 0,,
                  "multiport_range": "80, 5500-30000",
                  "ip_translation": "nat",
                  "tags": []
              }]
       }]
      "features": [],
    }]
  }
}

Get Cities (v2)

  • URL: <base url>/inventory/v2/cities/<sDeviceType>
  • Request Method: GET

Use this API to get a complete list of subscribed Cities.

Returns a JSON object that contains the Cities.

Payload

KeyTypePass inDescription
X-AccessToken*StringHeaderaccessToken retrieved from Get Access Token endpoint
sDeviceType*StringPathType of device
Possible values: android | ios | mac | windows
(*) Required Parameter

Response

KeyTypeDescription
headerJSONJSON object that describes return code and message.
bodyJSONJSON object that describes the return code and message.
citiesArrayJSON object that returns a cities array containing objects

Sample Response

{
  "header": {
    "message": "success"
    "response_code": 1,
  },
  "body": {
    "cities": [{
      "id": 22,
      "name": "Toronto",
      "country_id": 43,
      "country": "CA",
      "latitude": 43.6535,
      "longitude": -79.3839,
      "is_freemium":false,
      "recommended_protocol": "IKEV",
      "data_centers": [],
      "protocols": [{
        "number": 8,
        "protocol": "TCP",
         "dns": [{
           "configuration_version": "2.0,"
           "name": "cato2-auto-tcp.ptoserver.com",
           "type": "primary",
           "port_number": 80,
           "is_multiport": 0,
           "multiport_range": "80,5500-30000",
           "ip_translation": "nat",
           "tags": [],
       }]
      "features": [
        "OVPN_OBF",
        "QR",
        ]
      }]
    }]
  }
}
Share this Doc

Get Subscribed Cities

Or copy link

On This Page