Mamaritra ireo toerana ahafahanao mametraka VPS. Alefaso amin'ny alalan'ny location_id ny adiresin'ilay toerana rehefa mamorona mpizara iray ianao.
Maka ny lisitr'ireo toerana misy ny foibe angon-drakitra izay azonao ampiasaina amin'ny mpizara VPS.
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
}
]
}
| Field | Karazana | Fanoritsoritana |
|---|---|---|
id |
integer | Mpamantatra toerana. Ampiasao ho location_id rehefa mamorona mpizara iray. |
name |
string | Anaran'ilay toerana azo vakiana |
country_name |
string | Ny firenena misy ilay toerana |
country_code |
string | Famantarana firenena ISO 3166-1 alpha-2, litera lehibe |
is_active |
boolean | Raha mandray mpizara vaovao ilay toerana |
| 200 | Voaray soa aman-tsara ny lisitry ny toerana |
| 403 | Token API tsy misy na tsy mitombina, na tsy manana ny fahazoan-dàlana ilaina ilay token |
Maka toerana iray amin'ny alalan'ny ID-ny. Zavatra iray misy toerana iray miaraka amin'ireo sehatr'asa etsy ambony no valin'ny fangatahana.
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
}
Ny mpizara VPS.org tsirairay dia mandeha ao amin'ny toerana misy antsika ao New Jersey, Etazonia amin'izao fotoana izao, izay mandray ny mpanjifa manerana izao tontolo izao amin'ny alalan'ny IPv4 sy IPv6. Vakio foana ny toerana farany fa tsy ny famaritana ny ID, ka ny fampidiranao dia mandray toerana vaovao rehefa ampidirina izy ireo.