1. Create a token
Create an API client from the admin panel and save the token when it is shown for the first and only time.
YamanVM API
Swagger reference, quick language samples and onboarding guide in one place.
This page provides endpoint reference documentation. For a fast start, you can use the PHP, Node.js and Python examples below and then continue with the separate how-to guide.
Create an API client from the admin panel and save the token when it is shown for the first and only time.
`GET /api/v1/ping` is the fastest way to verify auth, headers and connectivity.
Provision, format and snapshot operations are asynchronous and return tasks; follow progress from task endpoints.
The examples below help you build the integration skeleton even without Swagger. For a more detailed tutorial, continue with the How-To Guide.
Plain PHP + cURL starter script.
php-client.phpSimple fetch-based starter script.
node-client.mjsRequests-based starter script.
python-client.pyImportable Postman collection.
postman_collection.json<?php
$baseUrl = rtrim('https://yamanvm.yamanhosting.com', '/');
$token = 'yvm_live_xxxxxxxxxxxxxxxxx';
$requestId = 'php-quickstart-001';
$headers = [
'Authorization: Bearer ' . $token,
'Accept: application/json',
'X-Request-Id: ' . $requestId,
];
$ch = curl_init($baseUrl . '/api/v1/ping');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => $headers,
]);
$raw = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$data = json_decode($raw, true);
var_dump($status, $data);
const baseUrl = 'https://yamanvm.yamanhosting.com';
const token = 'yvm_live_xxxxxxxxxxxxxxxxx';
const response = await fetch(`${baseUrl}/api/v1/servers`, {
headers: {
Authorization: `Bearer ${token}`,
Accept: 'application/json',
'X-Request-Id': 'node-quickstart-001',
},
});
const data = await response.json();
console.log(response.status, data);
import requests
base_url = "https://yamanvm.yamanhosting.com"
token = "yvm_live_xxxxxxxxxxxxxxxxx"
response = requests.get(
f"{base_url}/api/v1/servers/3/tasks",
headers={
"Authorization": f"Bearer {token}",
"Accept": "application/json",
"X-Request-Id": "python-quickstart-001",
},
timeout=30,
)
print(response.status_code)
print(response.json())