This documentation aims to provide all the information you need to work with our API.
Base URL
https://urbanshieldvpn-api.com
This API is not authenticated.
API for Client Application v3
Authenticates the user with given credentials. If everything is okay, you'll get Success Response.
The request will fail with a response of Invalid Credentials.
curl --request POST \
"https://urbanshieldvpn-api.com/v3/auth" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"testing\",
\"password\": \"testing\",
\"accountId\": \"test-test\",
\"deviceDetails\": {
\"type\": \"Window|Mac|Android|iOS\",
\"name\": \"Someone\'s iPhone\",
\"id\": \"<device_id>\"
}
}"
{
"response": {
"auth": true,
"active": true,
"expired": false,
"allowLogin": false,
"expiry_date": "dd-mmm-yyyy",
"ApiToken": "<token>",
"totalSessionsAllowed": 5,
"loggedInSessions": 0,
"timestamp": 0,
"is_paid": true,
"activeSessions": [
{
"tokenId": 1,
"details": {
"id": "<device_id>",
"name": "<device_name>",
"type": "<device_type>"
},
"last_used_at": "2022-04-23T13:57:31.000000Z",
"currentDevice": true
}
],
"email": "<email>",
"plan": "Premium"
},
"message": "Account logged in Successfully",
"state": true
}
Returns List of Servers.
The request will fail with a 402 error, and a response of Unauthorized.
curl --request GET \
--get "https://urbanshieldvpn-api.com/v3/servers-list" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
{
"servers": [
{
"id": 1,
"name": "Frankfurt - Germany",
"ip": "0.0.0.0",
"port": 443,
"flag": "ic_list_country_de",
"premium": true,
"country": "Germany",
"country_code": "de"
"dns1": "8.8.8.8",
"dns2": "8.8.8.8",
}
],
"dnsServers": {"dns1": "8.8.8.8", "dns2": "8.8.4.4" },
"openvpn": {
"certificate": certificate,
"ports": [{
"protocol": "tcp",
"port": 443
}]
},
"wireguard": [ 51820 ]
}
curl --request GET \
--get "https://urbanshieldvpn-api.com/v3/app/notification" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
cache-control
: no-cache, private
content-type
: application/json
access-control-allow-origin
: *
{
"message": "Unauthorized"
}
Get Details of Loggedin User
The request will fail with a 401 error if session is already revoked
curl --request GET \
--get "https://urbanshieldvpn-api.com/v3/details" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
{
"expired" : true,
"totalSessionsAllowed": 5,
"loggedInSessions": 0,
"activeSessions": [{
"tokenId": <token_id>,
"details": {
"id": "<device_id>",
"name": "<device_name>",
"type": "<device_type>"
},
"last_used_at": "2022-05-13T15:35:23.000000Z",
"currentDevice": true
}]
}
Revokes Current Logged-in Session
The request will fail with a 401 error if session is already revoked
curl --request POST \
"https://urbanshieldvpn-api.com/v3/signout" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
{
"message": "User logged out Successfully."
}
Revokes Session based on ID
ID of Device to be Logged out
The request will fail with a 401 error if session is already revoked
curl --request POST \
"https://urbanshieldvpn-api.com/v3/logout/20" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
{
"activeSessions": [{
"tokenId": <token_id>,
"details": {
"id": "<device_id>",
"name": "<device_name>",
"type": "<device_type>"
},
"last_used_at": "2022-05-13T15:35:23.000000Z",
"currentDevice": true
}]
}
Revokes All Sessions
The request will fail with a 401 error if session is already revoked
curl --request POST \
"https://urbanshieldvpn-api.com/v3/logout-all" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
{
"activeSessions": [{
"tokenId": <token_id>,
"details": {
"id": "<device_id>",
"name": "<device_name>",
"type": "<device_type>"
},
"last_used_at": "2022-05-13T15:35:23.000000Z",
"currentDevice": true
}]
}
Add Public Key to Wireguard Server.
The request will fail with a 401 error if session is already revoked
curl --request POST \
"https://urbanshieldvpn-api.com/v3/connect-to-vpn" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"country\": \"uyphx\",
\"city\": \"hic\"
}"
[{
'ip': 0.0.0.0,
'country' => 'Germany',
'city' => Frankfurt,
'wg' => [{
'publicKey' => "ijhasfd876089798uiohljkafsdd98s",
'port' => 51820,
'allowedIps' => '0.0.0.0/0',
}
}]
Delete Customer Account.
The request will fail with a 401 error if session is already revoked
curl --request POST \
"https://urbanshieldvpn-api.com/v3/delete" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
{
'message': 'Account Deleted Successfully'
}
Register Device for Firebase Notifications.
The request will fail with a 401 error if session is already revoked
curl --request POST \
"https://urbanshieldvpn-api.com/v3/notification/token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"token\": \"ezfgpajcnwldrhemo\"
}"
{
'message': 'Token Updated Successfully'
}
Update Customer Password..
The request will fail with a 401 error if session is already revoked
curl --request POST \
"https://urbanshieldvpn-api.com/v3/update-password" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
{
'message': 'Password updated successfully'
}
Set Password of Customer.
curl --request POST \
"https://urbanshieldvpn-api.com/v3/set-password" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"[email protected]\",
\"password\": \"L_sqG9+J%\",
\"confirm_password\": \"adekeowgeunopqxipfmxonllryfndnhdfjoqmcmonmmenirbgwpnzawzhcyclo\"
}"
{
'state': true,
'message': "Password Updated Successfully"
}
Verify OTP of Customer.
curl --request POST \
"https://urbanshieldvpn-api.com/v3/verify-otp" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"[email protected]\",
\"otp\": \"fqegaa\"
}"
{
'state': true,
'message': 'User Verified. Please proceed to set Password.'
'token': '<TOKEN>'
}
Email Customer to reset Password.
curl --request POST \
"https://urbanshieldvpn-api.com/v3/forget-password" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"[email protected]\"
}"
{
'state': true,
'message': 'A Verification Code has been sent to your email. Please check your Email.'
}
Email Customer to reset Password.
curl --request POST \
"https://urbanshieldvpn-api.com/v3/reset-password" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"[email protected]\"
}"
{
'state': true,
'message': 'A Verification Code has been sent to your email. Please check your Email.'
}
Plans Identifier for Apps
curl --request GET \
--get "https://urbanshieldvpn-api.com/v3/plans?platform=android%7Cios" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
[{
'plans': [{
'identifier':'com.example.monthly',
'days': 30,
'save': 0
}],
'subtitle': ''
}]
Restore Purchase of User on the basis of Account ID.
The request will fail with a 401 error if session is already revoked
curl --request POST \
"https://urbanshieldvpn-api.com/v3/restore-purchase" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"UUID\": \"86bea3e4-cd21-3b09-bf5d-ad1b983f4aed\"
}"
<JSON_OF_AUTH_RESPONSE>
curl --request GET \
--get "https://urbanshieldvpn-api.com/v3/country-list" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
{
'country': [{
'code': 'de',
"name": "Germany"
}]
}
Get Location of Current IP or IP Provided
curl --request GET \
--get "https://urbanshieldvpn-api.com/v3/location/ipsum" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
[{
'code': '<code>',
'country': '<country>',
'city': '<city>',
'latitude': '<latitude>',
'longitude': '<longitude>',
'ip': '<ip>',
"isp": '<isp>',
}]
Generate Code for TV Login to display on TV and then use it on website.
curl --request POST \
"https://urbanshieldvpn-api.com/v3/tv/generate" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
{
'code': 'OXVA-78I9',
'token': '<TOKEN>'
}
Poll every few seconds to check if User has Logged in on Website.
curl --request POST \
"https://urbanshieldvpn-api.com/v3/tv/poll" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"tvCode\": \"ut\"
}"
{
'is_login': true,
'message': 'Logged in Successfully',
'state': true,
'response': '<JSON_OF_AUTH_API>'
}
Login User on the basis of Firebase ID Token
curl --request POST \
"https://urbanshieldvpn-api.com/v3/sso/firebase" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"idToken\": \"exercitationem\"
}"
<JSON_OF_AUTH_RESPONSE>
API for VPN Accounts Management
Get details of account by username, email
The request will fail with a 401 error if auth token is revoked
Type of Search Column
Value to be searched
curl --request GET \
--get "https://urbanshieldvpn-api.com/v3/customers/find/username/testing" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
{
"id": 1,
"is_active": true,
"fta": false,
"username": "testing",
"password": "testing",
"status": "inactive",
"expiry_text": "30 Day(s) left",
"expiry_date": null,
"devices": 2,
"expiry_timestamp": null,
"created_date": "Jan 31, 1970 00:00:00 AM"
}
Creates New VPN Account for VPN Connection. One of duration or expiry_date parameters is necessary. if the duration is set expiry date of account will be set once account first time connects to vpn. or you can set expiry date directly.
The request will fail with a 401 error if auth token is revoked
curl --request POST \
"https://urbanshieldvpn-api.com/v3/customers" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"duration\": 13,
\"expiry_date\": 17,
\"devices\": 11,
\"firstname\": \"nklkuzn\",
\"lastname\": \"khqzlflfs\",
\"email\": \"[email protected]\",
\"username\": \"testing\",
\"password\": \"testing\",
\"group\": 16,
\"name\": \"aut\"
}"
{
"state": "success",
"message": "Account Created Successfully",
"data": {
"id": 1,
"is_active": true,
"fta": false,
"username": "testing",
"password": "testing",
"status": "inactive",
"expiry_text": "30 Day(s) left",
"expiry_date": null,
"devices": 2,
"expiry_timestamp": null,
"created_date": "Jan 31, 1970 00:00:00 AM"
}
}
Get Details of Account
The request will fail with a 401 error if auth token is revoked
The ID of the customer.
curl --request GET \
--get "https://urbanshieldvpn-api.com/v3/customers/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
{
"id": 1,
"is_active": true,
"fta": false,
"username": "testing",
"password": "testing",
"status": "inactive",
"expiry_text": "30 Day(s) left",
"expiry_date": null,
"devices": 2,
"expiry_timestamp": null,
"created_date": "Jan 31, 1970 00:00:00 AM"
}
Update Account Details
The request will fail with a 401 error if auth token is revoked
The ID of the customer.
curl --request PUT \
"https://urbanshieldvpn-api.com/v3/customers/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"firstname\": \"wnuowbasgpjiigglwpv\",
\"lastname\": \"xtp\",
\"email\": \"[email protected]\",
\"password\": \"testing\",
\"devices\": 3,
\"name\": \"molestias\"
}"
{
"state": "success",
"message": "Account Updated Successfully",
"data": {
"id": 1,
"is_active": true,
"fta": false,
"username": "testing",
"password": "testing",
"status": "inactive",
"expiry_text": "30 Day(s) left",
"expiry_date": null,
"devices": 2,
"expiry_timestamp": null,
"created_date": "Jan 31, 1970 00:00:00 AM"
}
}
Delete VPN Account.
The request will fail with a 401 error if session is expired
The ID of the customer.
curl --request DELETE \
"https://urbanshieldvpn-api.com/v3/customers/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
{
"state": "success",
"message": "Expiry Date updated Successfully."
}
Adds Duration to Expiry Date of Account.
The request will fail with a 401 error if session is expired
The ID of the customer.
curl --request PUT \
"https://urbanshieldvpn-api.com/v3/customers/1/duration/add" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"duration\": \"voluptates\"
}"
{
"state": "success",
"message": "Expiry Date updated Successfully.",
"data": {
""id": 1,
"is_active": true,
"fta": false,
"username": "testing",
"password": "testing",
"status": "inactive",
"expiry_text": "30 Day(s) left",
"expiry_date": null,
"devices": 2,
"expiry_timestamp": null,
"created_date": "Jan 31, 1970 00:00:00 AM"
}
}
Removes Duration From Account.
The request will fail with a 401 error if session is expired
The ID of the customer.
curl --request PUT \
"https://urbanshieldvpn-api.com/v3/customers/1/duration/remove" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"duration\": \"in\"
}"
{
"state": "success",
"message": "Expiry Date updated Successfully.",
"data": {
"id": 1,
"is_active": true,
"fta": false,
"username": "testing",
"password": "testing",
"status": "inactive",
"expiry_text": "30 Day(s) left",
"expiry_date": null,
"devices": 2,
"expiry_timestamp": null,
"created_date": "Jan 31, 1970 00:00:00 AM"
}
}
Updates Expiry of Account.
The request will fail with a 401 error if session is expired
The ID of the customer.
curl --request PUT \
"https://urbanshieldvpn-api.com/v3/customers/1/expiry" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"timestamp\": 12
}"
{
"state": "success",
"message": "Expiry Date updated Successfully.",
"data": {
"id": 1,
"is_active": true,
"fta": false,
"username": "testing",
"password": "testing",
"status": "inactive",
"expiry_text": "30 Day(s) left",
"expiry_date": null,
"devices": 2,
"expiry_timestamp": null,
"created_date": "Jan 31, 1970 00:00:00 AM"
}
}
Update is_active parameter of Account.
The request will fail with a 401 error if session is expired
The customer.
New State of Account
curl --request PUT \
"https://urbanshieldvpn-api.com/v3/customers/sit/true|false" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
{
"state": "success",
"message": "Account Activated",
}