{"id":10024,"date":"2024-06-10T11:19:29","date_gmt":"2024-06-10T11:19:29","guid":{"rendered":"https:\/\/www.purewl.com\/developer\/docs\/api-reference\/api-reference\/inventory-management\/cities\/"},"modified":"2025-02-19T10:25:09","modified_gmt":"2025-02-19T10:25:09","slug":"cities","status":"publish","type":"docs","link":"https:\/\/www.purewl.com\/developer\/guides\/api\/api-reference\/inventory-management\/cities\/","title":{"rendered":"Get Subscribed\u00a0Cities"},"content":{"rendered":"\n<p>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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"get-countries-v3\">Get Cities (v3)<\/h2>\n\n\n\n<ul>\n<li><strong>URL:&nbsp;<\/strong>&lt;base url&gt;\/inventory\/v3\/cities\/&lt;sDeviceType&gt;<\/li>\n\n\n\n<li><strong>Request Method:\u00a0<\/strong>GET<\/li>\n<\/ul>\n\n\n\n<p>Use this API to get a complete list of subscribed Cities.<\/p>\n\n\n\n<p>Returns a JSON object that contains the Cities.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Payload<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th class=\"has-text-align-left\" data-align=\"left\"><strong>Key<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>Type<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>Pass in<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>X-AccessToken<\/code>*<\/td><td class=\"has-text-align-left\" data-align=\"left\">String<\/td><td class=\"has-text-align-left\" data-align=\"left\">Header<\/td><td class=\"has-text-align-left\" data-align=\"left\"><kbd>accessToken<\/kbd> retrieved from <a href=\"https:\/\/www.purewl.com\/developer\/guides\/api\/api-reference\/api-access-authentication\/#get-access-token\" data-type=\"link\" data-id=\"https:\/\/www.purewl.com\/developer\/guides\/api\/api-reference\/inventory-management\/countries\/\" target=\"_blank\" rel=\"noreferrer noopener\">Get Access Token<\/a> endpoint<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>sDeviceType<\/code>*<\/td><td class=\"has-text-align-left\" data-align=\"left\">String<\/td><td class=\"has-text-align-left\" data-align=\"left\">Path<\/td><td class=\"has-text-align-left\" data-align=\"left\">Type of device<br>Possible values:&nbsp;<strong>android<\/strong>&nbsp;|&nbsp;<strong>ios<\/strong>&nbsp;|&nbsp;<strong>mac<\/strong>&nbsp;|&nbsp;<strong>windows<\/strong><\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">(*) Required Parameter<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Response<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th class=\"has-text-align-left\" data-align=\"left\"><strong>Key<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>Type<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>header<\/code><\/td><td class=\"has-text-align-left\" data-align=\"left\">JSON<\/td><td class=\"has-text-align-left\" data-align=\"left\">JSON object that describes return code and message.<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>body<\/code><\/td><td class=\"has-text-align-left\" data-align=\"left\">JSON<\/td><td class=\"has-text-align-left\" data-align=\"left\">JSON object that returns cities array containing objects<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>cities<\/code><\/td><td class=\"has-text-align-left\" data-align=\"left\">Array<\/td><td class=\"has-text-align-left\" data-align=\"left\">Array of object that contains id, name, protocols and other details of the city<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Sample Response<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-json\" data-lang=\"JSON\" data-show-lang=\"1\"><code>{\n  &quot;header&quot;: {\n    &quot;message&quot;: &quot;success&quot;\n    &quot;response_code&quot;: 1,\n  },\n  &quot;body&quot;: {\n    &quot;cities&quot;: [{\n      &quot;id&quot;: 22,\n      &quot;name&quot;: &quot;Toronto&quot;,\n      &quot;country_id&quot;: 43,\n      &quot;country&quot;: &quot;CA&quot;,\n      &quot;is_freemium&quot;: false,\n      &quot;recommended_protocol&quot;: &quot;IKEV&quot;,\n      &quot;latitude&quot;: 43.6535,\n      &quot;longitude&quot;: -79.3839,\n      &quot;data_centers&quot;: [],\n      &quot;protocols&quot;: [{\n         &quot;number&quot;: 8,\n         &quot;protocol&quot;: &quot;TCP&quot;,\n             &quot;dns&quot;: [{\n                  &quot;configuration_version&quot;: &quot;2.0&quot;,\n                  &quot;name&quot;: &quot;cato2-auto-tcp.ptoserver.com&quot;\n                  &quot;type&quot;: &quot;primary&quot;,\n                  &quot;port_number&quot;: 80,\n                  &quot;is_multiport&quot;: 0,,\n                  &quot;multiport_range&quot;: &quot;80, 5500-30000&quot;,\n                  &quot;ip_translation&quot;: &quot;nat&quot;,\n                  &quot;tags&quot;: []\n              }]\n       }]\n      &quot;features&quot;: [],\n    }]\n  }\n}<\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<h2 class=\"wp-block-heading\">Get Cities (v2)<\/h2>\n\n\n\n<ul>\n<li><strong>URL:&nbsp;<\/strong>&lt;base url&gt;\/inventory\/v2\/cities\/&lt;sDeviceType&gt;<\/li>\n\n\n\n<li><strong>Request Method:&nbsp;<\/strong>GET<\/li>\n<\/ul>\n\n\n\n<p>Use this API to get a complete list of subscribed Cities.<\/p>\n\n\n\n<p>Returns a JSON object that contains the Cities.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Payload<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th class=\"has-text-align-left\" data-align=\"left\"><strong>Key<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>Type<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>Pass in<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>X-AccessToken<\/code>*<\/td><td class=\"has-text-align-left\" data-align=\"left\">String<\/td><td class=\"has-text-align-left\" data-align=\"left\">Header<\/td><td class=\"has-text-align-left\" data-align=\"left\"><kbd>accessToken<\/kbd> retrieved from <a href=\"https:\/\/www.purewl.com\/developer\/guides\/api\/api-reference\/api-access-authentication\/#get-access-token\" data-type=\"link\" data-id=\"https:\/\/www.purewl.com\/developer\/guides\/api\/api-reference\/inventory-management\/countries\/\" target=\"_blank\" rel=\"noreferrer noopener\">Get Access Token<\/a> endpoint<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>sDeviceType<\/code>*<\/td><td class=\"has-text-align-left\" data-align=\"left\">String<\/td><td class=\"has-text-align-left\" data-align=\"left\">Path<\/td><td class=\"has-text-align-left\" data-align=\"left\">Type of device<br>Possible values:&nbsp;<strong>android<\/strong>&nbsp;|&nbsp;<strong>ios<\/strong>&nbsp;|&nbsp;<strong>mac<\/strong>&nbsp;|&nbsp;<strong>windows<\/strong><\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">(*) Required Parameter<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Response<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th class=\"has-text-align-left\" data-align=\"left\"><strong>Key<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>Type<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>header<\/code><\/td><td class=\"has-text-align-left\" data-align=\"left\">JSON<\/td><td class=\"has-text-align-left\" data-align=\"left\">JSON object that describes return code and message.<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>body<\/code><\/td><td class=\"has-text-align-left\" data-align=\"left\">JSON<\/td><td class=\"has-text-align-left\" data-align=\"left\">JSON object that describes the return code and message.<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>cities<\/code><\/td><td class=\"has-text-align-left\" data-align=\"left\">Array<\/td><td class=\"has-text-align-left\" data-align=\"left\">JSON object that returns a cities array containing objects<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Sample Response<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-json\" data-lang=\"JSON\" data-show-lang=\"1\"><code>{\n  &quot;header&quot;: {\n    &quot;message&quot;: &quot;success&quot;\n    &quot;response_code&quot;: 1,\n  },\n  &quot;body&quot;: {\n    &quot;cities&quot;: [{\n      &quot;id&quot;: 22,\n      &quot;name&quot;: &quot;Toronto&quot;,\n      &quot;country_id&quot;: 43,\n      &quot;country&quot;: &quot;CA&quot;,\n      &quot;latitude&quot;: 43.6535,\n      &quot;longitude&quot;: -79.3839,\n      &quot;is_freemium&quot;:false,\n      &quot;recommended_protocol&quot;: &quot;IKEV&quot;,\n      &quot;data_centers&quot;: [],\n      &quot;protocols&quot;: [{\n        &quot;number&quot;: 8,\n        &quot;protocol&quot;: &quot;TCP&quot;,\n         &quot;dns&quot;: [{\n           &quot;configuration_version&quot;: &quot;2.0,&quot;\n           &quot;name&quot;: &quot;cato2-auto-tcp.ptoserver.com&quot;,\n           &quot;type&quot;: &quot;primary&quot;,\n           &quot;port_number&quot;: 80,\n           &quot;is_multiport&quot;: 0,\n           &quot;multiport_range&quot;: &quot;80,5500-30000&quot;,\n           &quot;ip_translation&quot;: &quot;nat&quot;,\n           &quot;tags&quot;: [],\n       }]\n      &quot;features&quot;: [\n        &quot;OVPN_OBF&quot;,\n        &quot;QR&quot;,\n        ]\n      }]\n    }]\n  }\n}<\/code><\/pre><\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>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) Use this API to get a complete list of subscribed Cities. Returns a JSON object that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":9998,"menu_order":2,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/docs\/10024"}],"collection":[{"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/comments?post=10024"}],"version-history":[{"count":11,"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/docs\/10024\/revisions"}],"predecessor-version":[{"id":11110,"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/docs\/10024\/revisions\/11110"}],"up":[{"embeddable":true,"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/docs\/9998"}],"wp:attachment":[{"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/media?parent=10024"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/doc_tag?post=10024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}