VPS.org API

പരിശോധന എപിഐ സഹായക്കുറിപ്പുകള്‍Query

ലൊക്കേഷനുകൾ API

ഒരു VPS വിതരണത്തിനുള്ള സ്ഥലം കാണിയ്ക്കുക. ഒരു സര്‍വര്‍ നിര്‍മ്മിക്കുമ്പോള്‍ സ്ഥലത്തിന്റെ ഐഡി _ഐഡി ആയി പാസ് ചെയ്യുക.

എൻഡ്‌പോയിന്റുകൾ 2 endpoints
ബേസ് പാത്ത് /api/v1/locations
നേടുക /api/v1/locations/

എല്ലാ സ്ഥലങ്ങളുടെയും പട്ടിക

ലഭ്യമായ എല്ലാ ഡേറ്റാ സെന്‍റിമീറ്ററുകള്‍ക്കും VPS സര്‍വറുകള്‍ പരിഷ്കരിക്കാന്‍ സാധ്യമാകുന്ന സ്ഥലങ്ങള്‍ ലഭ്യമാക്കുക.

ഉദാഹരണ അഭ്യർത്ഥന

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);

ഉദാഹരണ പ്രതികരണം

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

പ്രതികരണ ഫീൽഡുകൾ

ഫീള്‍ഡ് ടൈപ്പ് ചെയ്യുക വിവരണം
id integer സ്ഥാനം തിരിച്ചറിയല്‍. ഒരു സര്‍വറിനെ സൃഷ്ടിക്കുമ്പോള്‍ ഇതു് സ്ഥാനം_ഐഡി ആയി ഉപയോഗിക്കുക.
name string മനുഷ്യനു വായിക്കുവാന്‍ സാധിക്കുന്ന സ്ഥലത്തിന്റെ പേരു്
country_name string രാജ്യം ഈ സ്ഥലത്തു്
country_code string ISO 3166-1 alpha-2 country code, uppercase
is_active boolean ഈ സ്ഥലം പുതിയ സര്‍വര്‍കള്‍ സ്വീകരിക്കണമോ എന്ന്

പ്രതികരണ സ്റ്റാറ്റസ് കോഡുകൾ

200 ലൊക്കേഷനുകളുടെ ലിസ്റ്റ് വിജയകരമായി വീണ്ടെടുത്തു.
403 API അടയാളം ലഭ്യമല്ല അല്ലെങ്കില്‍ ആവശ്യമുളള സൂചനയ്ക്ക് ലഭ്യമല്ല
നേടുക /api/v1/locations/{id}/

ഒരു സ്ഥാനം തിരഞ്ഞെടുക്കുക

ഐഡി ഉപയോഗിച്ച് ഒരു സ്ഥലം ലഭ്യമാക്കുക. മുകളില്‍ ഫീള്‍ഡുകളുള്ള ഒരു സ്ഥലമാണു് മറുപടി.

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
}

നിങ്ങളുടെ സെര്‍വറുകള്‍ പ്രവര്‍ത്തിക്കുന്നിടംComment

Every VPS.org server currently runs in our New Jersey, USA location, which serves customers worldwide over IPv4 and IPv6. Always read the locations endpoint rather than hardcoding an id, so your integration picks up new locations when they are added.