VPS.org API

Dokumentimi i API REST

API-ja e Vendndodhjeve

Liston pozicionet ku mund të instaloni një VPS. Përcille id-në e një pozicioni si location_id kur krijon një server.

Pikat fundore 2 endpoints
Shtegu Bazë /api/v1/locations
MERR /api/v1/locations/

Listo të gjitha vendndodhjet

Merr një listë gjitha vendeve të disponueshme të qendrave të të dhënave ku mund të vendosësh serverët VPS.

Shembull Kërkese

cURL
Python
JavaScript
PHP
curl -X GET "https://admin.vps.org/api/v1/locations/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
import requests

url = "https://admin.vps.org/api/v1/locations/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch('https://admin.vps.org/api/v1/locations/', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  }
});

const locations = await response.json();
console.log(locations);
$ch = curl_init('https://admin.vps.org/api/v1/locations/');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_API_TOKEN',
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$locations = json_decode($response, true);
curl_close($ch);

Shembull Përgjigjeje

{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 1,
      "name": "New Jersey",
      "country_name": "United States",
      "country_code": "US",
      "is_active": true
    }
  ]
}

Fushat e Përgjigjes

Fusha Lloji Përshkrimi
id integer Identifikuesi i pozicionit. Përdoret si location_id kur krijohet një server.
name string Emri i pozicionit në mënyrë të lexueshme
country_name string Vendi ku ndodhet pozicioni
country_code string Kodi i vendit ISO 3166-1 alfa-2, shkronja e madhe
is_active boolean Nëse pozicioni pranon serverë të rinj

Kodet e Statusit të Përgjigjes

200 Lista e vendndodhjeve u mor me sukses
403 Token i munguar apo i pavlefshëm API, ose token nuk ka të drejtat e kërkuara
MERR /api/v1/locations/{id}/

Gjej një pozicion

Merr një pozicion të vetëm sipas id-së së tij. Përgjigjia është një objekt pozicioni me fushat e mësipërme.

curl -X GET "https://admin.vps.org/api/v1/locations/1/" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
{
  "id": 1,
  "name": "New Jersey",
  "country_name": "United States",
  "country_code": "US",
  "is_active": true
}

Ku janë serverët tuaj

Çdo server VPS.org aktualisht rrjedh në pozicionin tonë në New Jersey, SHBA, i cili u shërben klientëve në mbarë botën nëpërmjet IPv4 dhe IPv6. Gjithmonë lexon pozicionet e pikës së fundit në vend të kodimit të id-së, kështu që integrimi juaj merr pozicionet e reja kur ato shtohen.