Info
Welcome to the VPNresellers API version 4.1. Visit the API access page to get the access token.
Accounts
Check an username
Before account creating this method can check that the username is able to be used and it does not exist in our database.
Example request:
curl -X GET -G "https://api.vpnresellers.com/v4_1/accounts/check_username?username={username}" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/accounts/check_username?username={username}");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get("https://api.vpnresellers.com/accounts/check_username?username={username}", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"message": "The username checking was successfully.",
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (404):
{
"message": "Account not found.",
"code": 404,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
Example response (422):
{
"message": "The username has already been taken.",
"errors": {
"username": [
"The username has already been taken."
]
},
"code": 422,
}
HTTP Request
GET v4_1/accounts/check_username
Query Parameters
| Parameter | Status | Description |
|---|---|---|
| username | required | A checked username |
List accounts
The response contains the following information:
- data: Array. List of accounts' objects. See Retrieve an account to get info about account's object.
- links: Object of links for getting the first, last, next and previous pages.
- meta: Object. Metadata of the current page:
- current_page: the number of the current page.
- from: the number of the first item in data.
- last_page: the number of the last page.
- path: the path of the current page.
- per_page: max number of items in data.
- to: the number of the last item in data.
- total: the number of items in data.
- code: Number. HTTP status code.
Example request:
curl -X GET -G "https://api.vpnresellers.com/v4_1/accounts" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/accounts");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get("https://api.vpnresellers.com/v4_1/accounts", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": [
{
"id": 9,
"username": "plmkojnhbgv",
"status": "Active",
"wg_ip": "10.250.121.219",
"wg_private_key": "XE1pI01BnHB1EmidlHdm55r2qHKBSWCCJtXeS9gC+WU=",
"wg_public_key": "w4oWBcymg+W+24NTb7FolqW9sumDnO0vhXXP19iQomM=",
"expired_at": "2023-04-18T00:00:00.000000Z",
"updated": "2017-03-28 17:44:21",
"created": "2017-03-24 19:26:24",
},
{
"id": 10,
"username": "wokreiru",
"status": "Active",
"wg_ip": "10.250.121.219",
"wg_private_key": "XE1pI01BnHB1EmidlHdm55r2qHKBSWCCJtXeS9gC+WU=",
"wg_public_key": "w4oWBcymg+W+24NTb7FolqW9sumDnO0vhXXP19iQomM=",
"updated": "2017-04-23 09:06:45",
"expired_at": null,
"created": "2017-03-27 17:22:45",
}
],
"links": {
"first": "https://api.vpnresellers.com/v4_1/accounts?page=1",
"last": "https://api.vpnresellers.com/v4_1/accounts?page=3",
"prev": null,
"next": "https://api.vpnresellers.com/v4_1/accounts?page=2",
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 3,
"links": [
{
"url": null,
"label": "« Previous",
"active": false,
},
{
"url": "https://api.vpnresellers.com/v4_1/accounts?page=1",
"label": "1",
"active": true,
},
{
"url": "https://api.vpnresellers.com/v4_1/accounts?page=2",
"label": "2",
"active": false,
},
{
"url": "https://api.vpnresellers.com/v4_1/accounts?page=3",
"label": "3",
"active": false,
},
{
"url": "https://api.vpnresellers.com/v4_1/accounts?page=2",
"label": "Next »",
"active": false
},
],
"path": "https://api.vpnresellers.com/v4_1/accounts",
"per_page": 15,
"to": 15,
"total": 33,
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
GET v4_1/accounts
Query Parameters
| Parameter | Status | Description |
|---|---|---|
| per_page | optional | A number of accounts on a page |
| page | optional | A number of page |
| status | optional | A status of accounts ("Active" or "Disabled") |
Create an account
This method requires following parameters:
- username: the field under validation may have alpha-numeric characters, as well as dashes, underscores, dots and "@". Also username must be at least 3 characters and may not be greater than 50 characters.
- password: the field must be at least 3 characters and may not be greater than 50 characters.
- customer: the field is optional and can be used to link a new account to an existing customer or create a new one with it. customer must be an object with attributes:
- customer_id: the field is optional and must be a customer identifier. If not specified, the attributes below will be used to create a new customer.
- first_name: the field must be at least 3 characters and may not be greater than 50 characters. Required if customer_id is not provided.
- last_name: the field must be at least 3 characters and may not be greater than 50 characters. Required if customer_id is not provided.
- email: the field must be a unique and valid email address. Required if customer_id is not provided.
- project_id: the field must be an existing project identifier. Required if customer_id is not provided.
Example request:
curl -X POST "https://api.vpnresellers.com/v4_1/accounts" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"username":"eius","password":"reprehenderit"}'
const url = new URL("https://api.vpnresellers.com/v4_1/accounts");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
let body = {
"username": "eius",
"password": "reprehenderit"
}
fetch(url, {
method: "POST",
headers: headers,
body: body,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post("https://api.vpnresellers.com/v4_1/accounts", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
"Content-Type" => "application/json",
],
'json' => [
"username" => "eius",
"password" => "reprehenderit",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (201):
{
"data": {
"id": 9,
"username": "plmkojnhbgv",
"status": "Active",
"wg_ip": "10.250.121.219",
"wg_private_key": "XE1pI01BnHB1EmidlHdm55r2qHKBSWCCJtXeS9gC+WU=",
"wg_public_key": "w4oWBcymg+W+24NTb7FolqW9sumDnO0vhXXP19iQomM=",
"expired_at": "2023-04-18T00:00:00.000000Z",
"updated": "2017-03-28 17:44:21",
"created": "2017-03-24 19:26:24"
},
"code": 201,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (404):
{
"message": "Account not found.",
"code": 404,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"password": [
"The password must be at least 6 characters."
]
},
"code": 422,
}
HTTP Request
POST v4_1/accounts
Body Parameters
| Parameter | Type | Status | Description |
|---|---|---|---|
| username | string | required | Username |
| password | string | required | Password |
| customer | object | optional | Customer object |
Customer Object Attributes
| Parameter | Type | Status | Description |
|---|---|---|---|
| customer_id | integer | optional | Customer identifier |
| first_name | string | required if customer_id is not provided | First name |
| last_name | string | required if customer_id is not provided | Last name |
| string | required if customer_id is not provided | Email address | |
| project_id | integer | required if customer_id is not provided | Project identifier |
Retrieve an account
The response contains the following information:
- data: Object of account contains following data:
- id: integer. Unique ID of account.
- username: string. Username.
- status: string. Available following statuses:
- Active: an account is enabled.
- Disabled: an account is disabled.
- wg_ip: string. Wireguard IP address.
- wg_private_key: string. Wireguard private key.
- wg_public_key: string. Wireguard public key.
- updated: string. The date and time when an account was updated.
- created: string. The date and time when an account was created.
Example request:
curl -X GET -G "https://api.vpnresellers.com/v4_1/{account}/show" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/{account}/show");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get("https://api.vpnresellers.com/{account}/show", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"id": 9,
"username": "plmkojnhbgv",
"status": "Active",
"wg_ip": "10.250.121.219",
"wg_private_key": "XE1pI01BnHB1EmidlHdm55r2qHKBSWCCJtXeS9gC+WU=",
"wg_public_key": "w4oWBcymg+W+24NTb7FolqW9sumDnO0vhXXP19iQomM=",
"expired_at": "2023-04-18T00:00:00.000000Z",
"updated": "2017-03-28 17:44:21",
"created": "2017-03-24 19:26:24"
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (404):
{
"message": "Account not found.",
"code": 404,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
GET v4_1/accounts/{account}
Delete an account
This method will delete an account from our database.
Example request:
curl -X DELETE "https://api.vpnresellers.com/v4_1/accounts/{account}" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/accounts/{account}");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
}
fetch(url, {
method: "DELETE",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->delete("https://api.vpnresellers.com/v4_1/accounts/{account}", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (404):
{
"message": "Account not found.",
"code": 404,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
DELETE v4_1/accounts/{account}
Enable an account
This method enables the account which was disabled using Disable an account method.
Example request:
curl -X PUT "https://api.vpnresellers.com/v4_1/accounts/{account}/enable" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/un/accounts/enable");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
}
fetch(url, {
method: "PUT",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put("https://api.vpnresellers.com/v4_1/un/accounts/enable", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"id": 9,
"username": "plmkojnhbgv",
"status": "Active",
"wg_ip": "10.250.121.219",
"wg_private_key": "XE1pI01BnHB1EmidlHdm55r2qHKBSWCCJtXeS9gC+WU=",
"wg_public_key": "w4oWBcymg+W+24NTb7FolqW9sumDnO0vhXXP19iQomM=",
"expired_at": "2023-04-18T00:00:00.000000Z",
"updated": "2017-03-28 17:44:21",
"created": "2017-03-24 19:26:24"
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (404):
{
"message": "Account not found.",
"code": 404,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
PUT v4_1/accounts/{account}/enable
Disable an account
This method can be used for disabling VPN service for this account without deleting it from our database.
Example request:
curl -X PUT "https://api.vpnresellers.com/v4_1/accounts/{account}/disable" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/un/accounts/enable");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
}
fetch(url, {
method: "PUT",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put("https://api.vpnresellers.com/v4_1/un/accounts/enable", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"id": 9,
"username": "plmkojnhbgv",
"status": "Active",
"wg_ip": "10.250.121.219",
"wg_private_key": "XE1pI01BnHB1EmidlHdm55r2qHKBSWCCJtXeS9gC+WU=",
"wg_public_key": "w4oWBcymg+W+24NTb7FolqW9sumDnO0vhXXP19iQomM=",
"expired_at": "2023-04-18T00:00:00.000000Z",
"updated": "2017-03-28 17:44:21",
"created": "2017-03-24 19:26:24"
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (404):
{
"message": "Account not found.",
"code": 404,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
PUT v4_1/{account}/disable
Change password
This method requires following parameter:
- password: the field must be at least 3 characters and may not be greater than 50 characters.
Example request:
curl -X PUT "https://api.vpnresellers.com/v4_1/accounts/{account}/change_password" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"password":"reprehenderit"}'
const url = new URL("https://api.vpnresellers.com/v4_1/accounts/{account}/change_password");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
let body = {
"password": "reprehenderit"
}
fetch(url, {
method: "PUT",
headers: headers,
body: body,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put("https://api.vpnresellers.com/v4_1/accounts/{account}/change_password", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
"Content-Type" => "application/json",
],
'json' => [
"password" => "reprehenderit",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"id": 9,
"username": "plmkojnhbgv",
"status": "Active",
"wg_ip": "10.250.121.219",
"wg_private_key": "XE1pI01BnHB1EmidlHdm55r2qHKBSWCCJtXeS9gC+WU=",
"wg_public_key": "w4oWBcymg+W+24NTb7FolqW9sumDnO0vhXXP19iQomM=",
"expired_at": "2023-04-18T00:00:00.000000Z",
"updated": "2017-03-28 17:44:21",
"created": "2017-03-24 19:26:24"
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (404):
{
"message": "Account not found.",
"code": 404,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"password": [
"The password must be at least 6 characters."
]
},
"code": 422,
}
HTTP Request
PUT v4_1/accounts/{account}/change_password
Body Parameters
| Parameter | Type | Status | Description |
|---|---|---|---|
| password | string | required | Password |
Expire an account
Set the date when the account should become expired. If the "expired_at" field is null, the account becomes Auto-Renewal. This method requires following parameter:
- expire_at: the field must be a date (the "Y-m-d" format), be equals to null or be missed.
Example request:
curl -X PUT "https://api.vpnresellers.com/v4_1/accounts/{account}/expire" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"expire_at":"2014-10-03"}'
const url = new URL("https://api.vpnresellers.com/v4_1/accounts/{account}/expire");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
let body = {
"expire_at": "2014-10-03"
}
fetch(url, {
method: "PUT",
headers: headers,
body: body,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put("https://api.vpnresellers.com/v4_1/accounts/{account}/expire", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
"Content-Type" => "application/json",
],
'json' => [
"expire_at" => "2014-10-03",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"id": 9,
"username": "plmkojnhbgv",
"status": "Active",
"wg_ip": "10.250.121.219",
"wg_private_key": "XE1pI01BnHB1EmidlHdm55r2qHKBSWCCJtXeS9gC+WU=",
"wg_public_key": "w4oWBcymg+W+24NTb7FolqW9sumDnO0vhXXP19iQomM=",
"expired_at": "2023-04-18T00:00:00.000000Z",
"updated": "2017-03-28 17:44:21",
"created": "2017-03-24 19:26:24"
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (404):
{
"message": "Account not found.",
"code": 404,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"password": [
"The password must be at least 6 characters."
]
},
"code": 422,
}
HTTP Request
PUT v4_1/accounts/{account}/expire
Body Parameters
| Parameter | Type | Status | Description |
|---|---|---|---|
| expire_at | date | optional | Date ('Y-m-d' format) or null |
Validate an account
This method can be used for validating an account that was created before by username and password. Following response status codes are returned in different cases:
- 200: the validation was successful.
- 460: there wasn't found accounts with this username.
- 461: the password check is failed with the account with this username.
- 422: the given data was invalid (parameters are required, they must be a string and no longer than 512 characters).
- 401: the given access token is missed or failed.
Example request:
curl -X POST "https://api.vpnresellers.com/v4_1/accounts/{account}/validate" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"username":"eius","password":"nemo"}'
const url = new URL("https://api.vpnresellers.com/v4_1/accounts/{account}/validate");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
let body = {
"username": "eius",
"password": "nemo"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post("https://api.vpnresellers.com/v4_1/accounts/{account}/validate", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
"Content-Type" => "application/json",
],
'json' => [
"username" => "eius",
"password" => "nemo",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"id": 12345,
"success": true,
"message": "Username has been successfully validated.",
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
Example response (460):
{
"message": ""Username has not been found.",
"code": 460,
}
Example response (461):
{
"message": "Username has not been validated.",
"code": 461,
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"username": [
"The username field is required."
]
},
"code": 422,
}
HTTP Request
POST v4_1/accounts/{account}/validate
Body Parameters
| Parameter | Type | Status | Description |
|---|---|---|---|
| username | string | required | Username |
| password | string | required | Password |
Enable an account by username
This method enables the account by username.
Example request:
curl -X PUT "https://api.vpnresellers.com/v4_1/un/accounts/enable" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"username":"eius"}'
const url = new URL("https://api.vpnresellers.com/v4_1/un/accounts/enable");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
let body = {
"username": "eius"
}
fetch(url, {
method: "PUT",
headers: headers,
body: body,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put("https://api.vpnresellers.com/v4_1/un/accounts/enable", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
"Content-Type" => "application/json",
],
'json' => [
"username" => "eius",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"id": 9,
"username": "plmkojnhbgv",
"status": "Active",
"wg_ip": "10.250.121.219",
"wg_private_key": "XE1pI01BnHB1EmidlHdm55r2qHKBSWCCJtXeS9gC+WU=",
"wg_public_key": "w4oWBcymg+W+24NTb7FolqW9sumDnO0vhXXP19iQomM=",
"expired_at": "2023-04-18T00:00:00.000000Z",
"updated": "2017-03-28 17:44:21",
"created": "2017-03-24 19:26:24"
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (404):
{
"message": "Account not found.",
"code": 404,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
PUT v4_1/un/accounts/enable
Disable an account by username
This method disables the account by username.
Example request:
curl -X PUT "https://api.vpnresellers.com/v4_1/un/accounts/disable" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"username":"eius"}'
const url = new URL("https://api.vpnresellers.com/v4_1/un/accounts/disable");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
let body = {
"username": "eius"
}
fetch(url, {
method: "PUT",
headers: headers,
body: body,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put("https://api.vpnresellers.com/v4_1/un/accounts/disable", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
"Content-Type" => "application/json",
],
'json' => [
"username" => "eius",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"id": 9,
"username": "plmkojnhbgv",
"status": "Active",
"wg_ip": "10.250.121.219",
"wg_private_key": "XE1pI01BnHB1EmidlHdm55r2qHKBSWCCJtXeS9gC+WU=",
"wg_public_key": "w4oWBcymg+W+24NTb7FolqW9sumDnO0vhXXP19iQomM=",
"expired_at": "2023-04-18T00:00:00.000000Z",
"updated": "2017-03-28 17:44:21",
"created": "2017-03-24 19:26:24"
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (404):
{
"message": "Account not found.",
"code": 404,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
PUT v4_1/un/accounts/disable
Change password by username
This method changes the password by username.
Example request:
curl -X PUT "https://api.vpnresellers.com/v4_1/un/accounts/change_password" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"username":"eius","password":"reprehenderit"}'
const url = new URL("https://api.vpnresellers.com/v4_1/un/accounts/change_password");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
let body = {
"username": "eius",
"password": "reprehenderit"
}
fetch(url, {
method: "PUT",
headers: headers,
body: body,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put("https://api.vpnresellers.com/v4_1/un/accounts/change_password", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
"Content-Type" => "application/json",
],
'json' => [
"username" => "eius",
"password" => "reprehenderit",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"id": 9,
"username": "plmkojnhbgv",
"status": "Active",
"wg_ip": "10.250.121.219",
"wg_private_key": "XE1pI01BnHB1EmidlHdm55r2qHKBSWCCJtXeS9gC+WU=",
"wg_public_key": "w4oWBcymg+W+24NTb7FolqW9sumDnO0vhXXP19iQomM=",
"expired_at": "2023-04-18T00:00:00.000000Z",
"updated": "2017-03-28 17:44:21",
"created": "2017-03-24 19:26:24"
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (404):
{
"message": "Account not found.",
"code": 404,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"password": [
"The password must be at least 6 characters."
]
},
"code": 422,
}
HTTP Request
PUT v4_1/un/accounts/change_password
Body Parameters
| Parameter | Type | Status | Description |
|---|---|---|---|
| username | string | required | Username |
| password | string | required | Password |
Retrieve an account by username
This method retrieves the account by username. The basic authentication is used for this API endpoint. In basic HTTP authentication, a request contains a header field in the form of Authorization: Basic < credentials >, where < credentials > is the Base64 encoding of account's username and password joined by a single colon :.
Example request:
curl -X GET -G "https://api.vpnresellers.com/v4_1/un/accounts/show?username={username}" \
-H "Authorization: Basic {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/un/accounts/show?username={username}");
let headers = {
"Authorization": "Basic {token}",
"Accept": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get("https://api.vpnresellers.com/un/accounts/show?username={username}", [
'headers' => [
"Authorization" => "Basic {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"id": 9,
"username": "plmkojnhbgv",
"status": "Active",
"wg_ip": "10.250.121.219",
"wg_private_key": "XE1pI01BnHB1EmidlHdm55r2qHKBSWCCJtXeS9gC+WU=",
"wg_public_key": "w4oWBcymg+W+24NTb7FolqW9sumDnO0vhXXP19iQomM=",
"expired_at": "2023-04-18T00:00:00.000000Z",
"updated": "2017-03-28 17:44:21",
"created": "2017-03-24 19:26:24"
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (404):
{
"message": "Account not found.",
"code": 404,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
GET v4_1/un/accounts/show
Query Parameters
| Parameter | Status | Description |
|---|---|---|
| username | required | A username of an account |
Configuration
Get an openvpn configuration
Retrieving of the openvpn configuration to access the VPN server. The server_id and the port_id parameters can be got in the List servers and the List ports methods.
Example request:
curl -X GET -G "https://api.vpnresellers.com/v4_1/configuration/openvpn?server_id=1&port_id=1" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/configuration/openvpn");
let params = {
"server_id": 1,
"port_id": 1,
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get("https://api.vpnresellers.com/v4_1/configuration/openvpn", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
'query' => [
"server_id" => 1,
"port_id" => 1,
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"content": "client\ndev tun\nremote bkk-s02.321inter.net\nport 123\nproto udp\npersist-key\npersist-tun\ncomp-lzo\nauth-user-pass\nnobind\nca ca.crt\nauth SHA256\ncipher AES-256-CBC\nkeysize 256\nfloat\ntun-mtu 48000\nfragment 0\nmssfix 0\n\n<ca>\n -----BEGIN CERTIFICATE-----\n MIIE3zCCA8egAwIBAgIJAKJYeXSXJzkNMA0GCSqGSIb3DQEBCwUAMIGlMQswCQYD\n VQQGEwJVUzELMAkGA1UECBMCVVMxEDAOBgNVBAcTB1ZQTkFzaXYxEDAOBgNVBAoT\n B1ZQTkFzaWExHTAbBgNVBAsTFE15T3JnYW5pemF0aW9uYWxVbml0MREwDwYDVQQD\n EwhjaGFuZ2VtZTEQMA4GA1UEKRMHRWFzeVJTQTEhMB8GCSqGSIb3DQEJARYSbWVA\n bXlob3N0Lm15ZG9tYWluMB4XDTE2MDIxNTIwMzIzNVoXDTI2MDIxMjIwMzIzNVow\n gaUxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJVUzEQMA4GA1UEBxMHVlBOQXNpdjEQ\n MA4GA1UEChMHVlBOQXNpYTEdMBsGA1UECxMUTXlPcmdhbml6YXRpb25hbFVuaXQx\n ETAPBgNVBAMTCGNoYW5nZW1lMRAwDgYDVQQpEwdFYXN5UlNBMSEwHwYJKoZIhvcN\n AQkBFhJtZUBteWhvc3QubXlkb21haW4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw\n ggEKAoIBAQC3Qjh2JiLulXZkyjB9xb136o\/hy3UbHA0lnIovO1RI320TeOIbgfNr\n 3ZWcnNc1Fh4+SZbD4nZwe5Zk8PHdrm6dFM16CYU+vxaAnao8dbLRKnJq076zLzHr\n Wb12BI+yBr605cFqIFVYNtnPvzKYVd2vPGkA7BrZ7qUPMMPqaopQFUOfNh0QRTqp\n gcrAgexvkn3ia3IbEfd3OeFzU333buSu7\/+O55yS1\/lybfJyXQsxIDIPKe\/ZcIoL\n M9oK2x1uIHDcNa2uCsbphXVuuhtNgKDDU3AIga4MO\/5KpApFJfRLkCv7J+sAzVj1\n UwCcuqqNoY3CgKKsHwWlWgpN++KVGvLbAgMBAAGjggEOMIIBCjAdBgNVHQ4EFgQU\n QN6oOLM0U3kbaL\/y8Z2ZTZOJ7W4wgdoGA1UdIwSB0jCBz4AUQN6oOLM0U3kbaL\/y\n 8Z2ZTZOJ7W6hgaukgagwgaUxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJVUzEQMA4G\n A1UEBxMHVlBOQXNpdjEQMA4GA1UEChMHVlBOQXNpYTEdMBsGA1UECxMUTXlPcmdh\n bml6YXRpb25hbFVuaXQxETAPBgNVBAMTCGNoYW5nZW1lMRAwDgYDVQQpEwdFYXN5\n UlNBMSEwHwYJKoZIhvcNAQkBFhJtZUBteWhvc3QubXlkb21haW6CCQCiWHl0lyc5\n DTAMBgNVHRMEBTADAQH\/MA0GCSqGSIb3DQEBCwUAA4IBAQCFE5WZ5M0yid0ow\/7Z\n \/X4UIGvgvLwMK8JXkomcleRpVCXz2s55C6Huo0\/v\/UyOjP\/VU+MhKQrAgNmDPHwL\n 2Q+b6m3hxLiQ96C3j7nhqnRNsuU3Dm8KEOXC45QPFJZx5tCeqTCBPb874RdY\/vWg\n ZafdHFiCYxjiMnLk00I2DInVG5GDnwjQt6hqAN\/t+i\/q+Gl9fZXOP5CLIp7pxAmQ\n 5IAQSz4jnNHBtggS3h0055coNSMfGPS3z4jX8MMdEkXCGuLQW01mTZ+KuluWCo\/4\n PUuYbrMZW\/gQ\/T4hVgxYgraL0scjXidJhEJSgj4k3niJHcF\/j0mjZAYInv+d5UCv\n FjHt\n -----END CERTIFICATE-----\n\n<\/ca>",
"name": "TH-123.ovpn"
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"server_id": [
"The server id field is required."
],
"port_id": [
"The selected port id is invalid."
]
},
"code": 422,
}
HTTP Request
GET v4_1/configuration/openvpn
Query Parameters
| Parameter | Status | Description |
|---|---|---|
| server_id | required | Server ID |
| port_id | required | Port ID |
Headers (one of these headers is required)
| Header | Status | Description |
|---|---|---|
| Accept: application/json | optional | Get a configuration in JSON format |
| Accept: text/html; charset=UTF-8 | optional | Download a configuration |
Get a wireguard configuration
Retrieving of the wireguard configuration to access the VPN server. The server_id parameter can be got in the List servers method.
Example request:
curl -X GET -G "https://api.vpnresellers.com/v4_1/configuration/wireguard?server_id=1&account_id=1" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/configuration/wireguard");
let params = {
"server_id": 1,
"account_id": 1,
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get("https://api.vpnresellers.com/v4_1/configuration/wireguard", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
'query' => [
"server_id" => 1,
"account_id" => 1,
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"content": "[Interface]\nPrivateKey = zUv7atadVRGOx58h\nAddress = 240.170.225.79\nDNS = 172.16.0.1\n\n[Peer]\nPublicKey = WxwZf+b2RTA0ixXq\/j6z9oVdnS75HxXDVadM1nC36BY=\nAllowedIPs = 0.0.0.0\/0,::\/0\nEndpoint = eu-de-fra.321inter.net:55888\n",
"name": "wg0.conf"
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"server_id": [
"The server id field is required."
]
},
"code": 422,
}
HTTP Request
GET v4_1/configuration/wireguard
Query Parameters
| Parameter | Status | Description |
|---|---|---|
| server_id | required | Server ID |
| account_id | required | Account ID |
Headers (one of these headers is required)
| Header | Status | Description |
|---|---|---|
| Accept: application/json | optional | Get a configuration in JSON format |
| Accept: text/html; charset=UTF-8 | optional | Download a configuration |
Geo Location
Get geo info
Example request:
curl -X GET -G "https://api.vpnresellers.com/v4_1/geoip" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/geoip");
let headers = {
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get("https://api.vpnresellers.com/v4_1/geoip", [
'headers' => [
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"ip": "127.0.0.0",
"country": "United States",
"iso_code": "US",
"city": "New Haven",
"lat": 41.31,
"lon": -72.92,
"continent": "NA"
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
GET v4_1/geoip
Servers
List servers
This method is used for retrieving list of all servers which are used in Get an openvpn configuration and Get a wireguard configuration methods.
Example request:
curl -X GET -G "https://api.vpnresellers.com/v4_1/servers" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/servers");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get("https://api.vpnresellers.com/v4_1/servers", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": [
{
"id": 1,
"name": "ams-s02.321inter.net",
"ip": "46.249.36.188",
"country_code": "NL",
"city": "Amsterdam",
"capacity": 0
},
{
"id": 2,
"name": "rtm-s01.321inter.net",
"ip": "213.163.64.39",
"country_code": "NL",
"city": "Rotterdam",
"capacity": 0
},
{
"id": 3,
"name": "bkk-s02.321inter.net",
"ip": "45.64.186.109",
"country_code": "TH",
"city": "Bangkok",
"capacity": 0
},
{
"id": 4,
"name": "yvr-s01.321inter.net",
"ip": "71.19.251.107",
"country_code": "CA",
"city": "Vancouver",
"capacity": 0
}
]
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (402):
{
"message": "Insufficient Balance.",
"code": 402,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
GET v4_1/servers
Ports
List ports
This method is used for retrieving list of all ports which are using in Get an openvpn configuration and Get a wireguard configuration methods.
Example request:
curl -X GET -G "https://api.vpnresellers.com/v4_1/ports" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/ports");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get("https://api.vpnresellers.com/v4_1/ports", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": [
{
"id": 1,
"protocol": "udp",
"number": 1194,
"default": 1
},
{
"id": 2,
"protocol": "udp",
"number": 118,
"default": 0
},
{
"id": 3,
"protocol": "udp",
"number": 123,
"default": 0
}
],
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
GET v4_1/ports
Profile
Retrieve a profile
Example request:
curl -X GET -G "https://api.vpnresellers.com/v4_1/profile" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/profile");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get("https://api.vpnresellers.com/profile", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"balance": "253.70",
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (404):
{
"message": "Account not found.",
"code": 404,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
GET v4_1/profile
Customers
List customers
Example request:
curl -X GET -G "https://api.vpnresellers.com/v4_1/customers" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/customers");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get("https://api.vpnresellers.com/customers", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": [
0: {
"id": 1,
"first_name": "Jefferey",
"last_name": "Barrows",
"email": "jefferey.barrows@nolan.com",
"user_id": 3595,
"project_id": 1,
},
],
"links": [
"first": "https://api.vpnresellers.com/v4_1/customers?page=1",
"last": "https://api.vpnresellers.com/v4_1/customers?page=1",
"prev": null,
"next": null,
],
"meta": [
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
0: [
"url": null,
"label": "« Previous",
"active": false,
],
1: [
"url": "https://api.vpnresellers.com/v4_1/customers?page=1",
"label": "1",
"active": true,
],
2: [
"url": null,
"label": "Next »",
"active": false,
],
],
"path": "https://api.vpnresellers.com/v4_1/customers",
"per_page": 15,
"to": 1,
"total": 1,
],
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
GET v4_1/customers
Create a customer
This method requires following parameter:
- first_name: the field must be at least 3 characters and may not be greater than 50 characters.
- last_name: the field must be at least 3 characters and may not be greater than 50 characters.
- email: the field must be a unique and valid email address.
- project_id: the field must be an existing project identifier.
Example request:
curl -X POST "https://api.vpnresellers.com/v4_1/customers/{customer}" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"first_name":"Jefferey","last_name":"Barrows","email":"jefferey.barrows@nolan.com","project_id":1}'
const url = new URL("https://api.vpnresellers.com/v4_1/customers/{customer}");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
let body = {
"first_name": "Jefferey",
"last_name": "Barrows",
"email": "jefferey.barrows@nolan.com",
"project_id": 1
}
fetch(url, {
method: "POST",
headers: headers,
body: body,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post("https://api.vpnresellers.com/v4_1/customers/{customer}", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
"Content-Type" => "application/json",
],
'json' => [
"first_name" => "Jefferey",
"last_name" => "Barrows",
"email" => "jefferey.barrows@nolan.com",
"project_id" => 1,
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"id": 1,
"first_name": "Jefferey",
"last_name": "Barrows",
"email": "jefferey.barrows@nolan.com",
"user_id": 3595,
"project_id": 1,
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
Example response (422):
{
"message": "The email has already been taken.",
"errors": {
"email": [
"The email has already been taken."
]
},
"code": 422,
}
HTTP Request
POST v4_1/customers/{customer}
Body Parameters
| Parameter | Type | Status | Description |
|---|---|---|---|
| first_name | string | required | First name |
| last_name | string | required | Last name |
| string | required | Email address | |
| project_id | integer | required | Project identifier |
Retrieve a customer
Example request:
curl -X GET -G "https://api.vpnresellers.com/v4_1/customers/{customer}" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/customers/{customer}");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get("https://api.vpnresellers.com/customers/{customer}", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"id": 1,
"first_name": "Jefferey",
"last_name": "Barrows",
"email": "jefferey.barrows@nolan.com",
"user_id": 3595,
"project_id": 1,
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
GET v4_1/customers/{customer}
Edit a customer
This method requires following parameter:
- first_name: the field must be at least 3 characters and may not be greater than 50 characters.
- last_name: the field must be at least 3 characters and may not be greater than 50 characters.
- email: the field must be a unique and valid email address.
Example request:
curl -X PUT "https://api.vpnresellers.com/v4_1/customers/{customer}" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"first_name":"Jefferey","last_name":"Barrows","email":"jefferey.barrows@nolan.com"}'
const url = new URL("https://api.vpnresellers.com/v4_1/customers/{customer}");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
let body = {
"first_name": "Jefferey",
"last_name": "Barrows",
"email": "jefferey.barrows@nolan.com"
}
fetch(url, {
method: "PUT",
headers: headers,
body: body,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put("https://api.vpnresellers.com/v4_1/customers/{customer}", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
"Content-Type" => "application/json",
],
'json' => [
"first_name" => "Jefferey",
"last_name" => "Barrows",
"email" => "jefferey.barrows@nolan.com",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
Example response (422):
{
"message": "The email has already been taken.",
"errors": {
"email": [
"The email has already been taken."
]
},
"code": 422,
}
HTTP Request
PUT v4_1/customers/{customer}
Body Parameters
| Parameter | Type | Status | Description |
|---|---|---|---|
| first_name | string | optional | First name |
| last_name | string | optional | Last name |
| string | optional | Email address |
Delete a customer
Example request:
curl -X DELETE "https://api.vpnresellers.com/v4_1/customers/{customer}" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/customers/{customer}");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
}
fetch(url, {
method: "DELETE",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->delete("https://api.vpnresellers.com/v4_1/customers/{customer}", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
Example response (422):
{
"message": "Unable to delete a customer that has accounts.",
"errors": {
"customer": [
"Unable to delete a customer that has accounts."
]
},
"code": 422,
}
HTTP Request
DELETE v4_1/customers/{customer}
List customer accounts
Example request:
curl -X GET -G "https://api.vpnresellers.com/v4_1/customers/{customer}/accounts" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/customers/{customer}/accounts");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get("https://api.vpnresellers.com/customers/{customer}/accounts", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": [
0: {
"id": 9,
"username": "plmkojnhbgv",
"status": "Active",
"wg_ip": "10.250.121.219",
"wg_private_key": "XE1pI01BnHB1EmidlHdm55r2qHKBSWCCJtXeS9gC+WU=",
"wg_public_key": "w4oWBcymg+W+24NTb7FolqW9sumDnO0vhXXP19iQomM=",
"expired_at": "2023-04-18T00:00:00.000000Z",
"updated": "2017-03-28 17:44:21",
"created": "2017-03-24 19:26:24"
},
],
"links": [
"first": "https://api.vpnresellers.com/v4_1/customers/{customer}/accounts?page=1",
"last": "https://api.vpnresellers.com/v4_1/customers/{customer}/accounts?page=1",
"prev": null,
"next": null,
],
"meta": [
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
0: [
"url": null,
"label": "« Previous",
"active": false,
],
1: [
"url": "https://api.vpnresellers.com/v4_1/customers/{customer}/accounts?page=1",
"label": "1",
"active": true,
],
2: [
"url": null,
"label": "Next »",
"active": false,
],
],
"path": "https://api.vpnresellers.com/v4_1/customers/{customer}/accounts",
"per_page": 15,
"to": 1,
"total": 1,
],
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
GET v4_1/customers/{customer}/accounts
Projects
List projects
Example request:
curl -X GET -G "https://api.vpnresellers.com/v4_1/projects" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/projects");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get("https://api.vpnresellers.com/projects", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": [
0: {
"id": 1,
"name": "TestProject",
"description": "New project for test.",
"user_id": 3595,
},
],
"links": [
"first": "https://api.vpnresellers.com/v4_1/projects?page=1",
"last": "https://api.vpnresellers.com/v4_1/projects?page=1",
"prev": null,
"next": null,
],
"meta": [
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
0: [
"url": null,
"label": "« Previous",
"active": false,
],
1: [
"url": "https://api.vpnresellers.com/v4_1/projects?page=1",
"label": "1",
"active": true,
],
2: [
"url": null,
"label": "Next »",
"active": false,
],
],
"path": "https://api.vpnresellers.com/v4_1/projects",
"per_page": 15,
"to": 1,
"total": 1,
],
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
GET v4_1/projects
Create a project
This method requires following parameter:
- name: the field must be at least 3 characters and may not be greater than 50 characters.
- description: the field may not be greater than 500 characters.
Example request:
curl -X POST "https://api.vpnresellers.com/v4_1/projects/{project}" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"name":"TestProject","description":"New project for test."}'
const url = new URL("https://api.vpnresellers.com/v4_1/projects/{project}");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
let body = {
"name": "TestProject",
"description": "New project for test."
}
fetch(url, {
method: "POST",
headers: headers,
body: body,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post("https://api.vpnresellers.com/v4_1/projects/{project}", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
"Content-Type" => "application/json",
],
'json' => [
"name" => "TestProject",
"description" => "New project for test.",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"id": 1,
"name": "TestProject",
"description": "New project for test.",
"user_id": 3595,
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
POST v4_1/projects/{project}
Body Parameters
| Parameter | Type | Status | Description |
|---|---|---|---|
| name | string | required | Project name |
| description | string | required | Project description |
Retrieve a project
Example request:
curl -X GET -G "https://api.vpnresellers.com/v4_1/projects/{project}" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/projects/{project}");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get("https://api.vpnresellers.com/projects/{project}", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"id": 1,
"name": "TestProject",
"description": "New project for test.",
"user_id": 3595,
},
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
GET v4_1/projects/{project}
Edit a project
This method requires following parameter:
- name: the field must be at least 3 characters and may not be greater than 50 characters.
- description: the field may not be greater than 500 characters.
Example request:
curl -X PUT "https://api.vpnresellers.com/v4_1/projects/{project}" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"name":"TestProject","description":"New project for test."}'
const url = new URL("https://api.vpnresellers.com/v4_1/projects/{project}");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
let body = {
"name": "TestProject",
"description": "New project for test."
}
fetch(url, {
method: "PUT",
headers: headers,
body: body,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put("https://api.vpnresellers.com/v4_1/projects/{project}", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
"Content-Type" => "application/json",
],
'json' => [
"name" => "TestProject",
"description" => "New project for test.",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
PUT v4_1/projects/{project}
Body Parameters
| Parameter | Type | Status | Description |
|---|---|---|---|
| name | string | required | Project name |
| description | string | required | Project description |
Delete a project
Example request:
curl -X DELETE "https://api.vpnresellers.com/v4_1/projects/{project}" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/projects/{project}");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
}
fetch(url, {
method: "DELETE",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->delete("https://api.vpnresellers.com/v4_1/projects/{project}", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
Example response (422):
{
"message": "Unable to delete a project that has customers.",
"errors": {
"project": [
"Unable to delete a project that has customers."
]
},
"code": 422,
}
HTTP Request
DELETE v4_1/projects/{project}
List project customers
Example request:
curl -X GET -G "https://api.vpnresellers.com/v4_1/projects/{project}/customers" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/projects/{project}/customers");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get("https://api.vpnresellers.com/projects/{project}/customers", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": [
0: {
"id": 1,
"first_name": "Jefferey",
"last_name": "Barrows",
"email": "jefferey.barrows@nolan.com",
"user_id": 3595,
"project_id": 1,
},
],
"links": [
"first": "https://api.vpnresellers.com/v4_1/projects/{project}/customers?page=1",
"last": "https://api.vpnresellers.com/v4_1/projects/{project}/customers?page=1",
"prev": null,
"next": null,
],
"meta": [
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
0: [
"url": null,
"label": "« Previous",
"active": false,
],
1: [
"url": "https://api.vpnresellers.com/v4_1/projects/{project}/customers?page=1",
"label": "1",
"active": true,
],
2: [
"url": null,
"label": "Next »",
"active": false,
],
],
"path": "https://api.vpnresellers.com/v4_1/projects/{project}/customers",
"per_page": 15,
"to": 1,
"total": 1,
],
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
GET v4_1/projects/{project}/customers
List project accounts
Example request:
curl -X GET -G "https://api.vpnresellers.com/v4_1/projects/{project}/accounts" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
const url = new URL("https://api.vpnresellers.com/v4_1/projects/{project}/accounts");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get("https://api.vpnresellers.com/projects/{project}/accounts", [
'headers' => [
"Authorization" => "Bearer {token}",
"Accept" => "application/json",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": [
0: {
"id": 9,
"username": "plmkojnhbgv",
"status": "Active",
"wg_ip": "10.250.121.219",
"wg_private_key": "XE1pI01BnHB1EmidlHdm55r2qHKBSWCCJtXeS9gC+WU=",
"wg_public_key": "w4oWBcymg+W+24NTb7FolqW9sumDnO0vhXXP19iQomM=",
"expired_at": "2023-04-18T00:00:00.000000Z",
"updated": "2017-03-28 17:44:21",
"created": "2017-03-24 19:26:24"
},
],
"links": [
"first": "https://api.vpnresellers.com/v4_1/projects/{project}/accounts?page=1",
"last": "https://api.vpnresellers.com/v4_1/projects/{project}/accounts?page=1",
"prev": null,
"next": null,
],
"meta": [
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
0: [
"url": null,
"label": "« Previous",
"active": false,
],
1: [
"url": "https://api.vpnresellers.com/v4_1/projects/{project}/accounts?page=1",
"label": "1",
"active": true,
],
2: [
"url": null,
"label": "Next »",
"active": false,
],
],
"path": "https://api.vpnresellers.com/v4_1/projects/{project}/accounts",
"per_page": 15,
"to": 1,
"total": 1,
],
"code": 200,
}
Example response (400):
{
"message": "Bad Request.",
"code": 400,
}
Example response (401):
{
"message": "Unauthorized.",
"code": 401,
}
Example response (403):
{
"message": "Forbidden.",
"code": 403,
}
Example response (405):
{
"message": "Method Not Allowed.",
"code": 405,
}
HTTP Request
GET v4_1/projects/{project}/accounts