Примеры кода
Примеры использования API на разных языках
JavaScript (Node.js)
const response = await fetch('https://api.vialine.ru/v1/slots', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data.slots);
Python
import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
response = requests.get(
'https://api.vialine.ru/v1/slots',
headers=headers
)
print(response.json())
cURL
curl -X GET "https://api.vialine.ru/v1/slots" \\
-H "Authorization: Bearer YOUR_API_KEY" \\
-H "Content-Type: application/json"