Язык
curl --request GET \
--url 'https://mrp.zolotenkov.ru/api/external/v1/manufacturing-orders/42/tasks' \
--header 'Authorization: Bearer zol_pat_live_ВАШ_КЛЮЧ' \
--header 'Accept: application/json'
const response = await fetch("https://mrp.zolotenkov.ru/api/external/v1/manufacturing-orders/42/tasks", {
method: "GET",
headers: {
"Authorization": "Bearer zol_pat_live_ВАШ_КЛЮЧ",
},
});
const data = await response.json();
import requests
response = requests.get(
"https://mrp.zolotenkov.ru/api/external/v1/manufacturing-orders/42/tasks",
headers={
"Authorization": "Bearer zol_pat_live_ВАШ_КЛЮЧ",
},
timeout=30,
)
response.raise_for_status()
print(response.json())
<?php
$curl = curl_init('https://mrp.zolotenkov.ru/api/external/v1/manufacturing-orders/42/tasks');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer zol_pat_live_ВАШ_КЛЮЧ",
"Accept: application/json",
],
]);
$response = curl_exec($curl);
var_dump(json_decode($response, true));
Ответ
{
"data": [
{
"actual_cost_cents": 10,
"actual_time_minutes": 10,
"cost_per_hour": 900,
"duration": 0.5,
"id": "42",
"manufacturing_order_id": "42",
"operation_id": "42",
"operation_title": "Сборка",
"operation_type": "MAKE_TO_STOCK",
"position": 1,
"resource_id": "42",
"resource_name": "Сборочный участок",
"status": "OPEN",
"total_cost": 4500
}
]
}
{
"error": "unauthorized",
"message": "Missing Authorization header",
"request_id": "req_cyX5W3UaT8KsYDN7GUEkdW"
}
{
"error": "forbidden",
"message": "Missing required scope 'read:manufacturing'",
"request_id": "req_cyX5W3UaT8KsYDN7GUEkdW"
}
{
"error": "not_found",
"message": "Resource not found",
"request_id": "req_cyX5W3UaT8KsYDN7GUEkdW"
}
{
"error": "rate_limited",
"message": "Rate limit exceeded",
"request_id": "req_cyX5W3UaT8KsYDN7GUEkdW"
}
Примеры собраны из схем ответов. Машинная форма —
в спецификации OpenAPI.