Ka yi jerin wuraren da za ka iya shigar da VPS. Ka wuce alamar wurin kamar alamar_lokaci idan ka ƙirƙiri wani mai ba da sabis.
@ action
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
}
]
}
| @ action | Nau'i | @ action |
|---|---|---|
id |
integer | Mai gane wurin. Yi amfani da shi kamar location_id idan an ƙirƙiri wani mai ba da sabis. |
name |
string | Sunan wurin da za'a iya karantawa da mutum |
country_name |
string | Jihar da wurin yake. |
country_code |
string | Kodi na ƙasar ISO 3166-1 alpha-2, a cikin haruffan girma. |
is_active |
boolean | Ko wurin yana karɓar sabon masu watsawa |
| 200 | An yi nasarar dawo da jerin wurare |
| 403 | An rasa ko kuma an karya tabbacin API, ko kuma tabbacin bai da izinin da ake bukata |
Duba wuri ɗaya ta amfani da lambar sirrin sa. Amsar da za a samu ita ce wuri ɗaya, wanda yake da sauran sune sunaye da aka ambata.
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
}
Kowane sabarin VPS.org na gudanar da aiki a wurinmu da ke New Jersey, Amurka, wanda ke hidima ga abokin ciniki a duniya ta hanyar IPv4 da IPv6. Kuma koyaushe ku duba wurin da ake hidima, maimakon amfani da wani sashi na gaba ɗaya, domin idan an ƙara wani wuri, tsarin ku zai iya samun sabbin wurare.