...
| Блок кода | ||
|---|---|---|
| ||
// Выполняем запрос на получение списка юзеров
$response = http.request("https://iam.twin24.ai/api/v1/users", "GET", {"limit": 15, "offset": 5}, {"Authorization": "Bearer authToken"})
// Извлекаем информацию о запросе
$statusCode = $response.get("statusCode")
$body = $response.get("body")
$headers = $response.get("headers")
$exception = $response.get("exception")
// Можно извлечь так
{"statusCode": $statusCode, "body": $body, "headers": $headers, "exception": $exception} = $response
// Или даже так (тут важен порядок перечисления переменных)
($statusCode, $body, $headers, $exception) = $response
// или
[$statusCode, $body, $headers, $exception] = $response
// получаем общее количество юзеров и их список
$userCount = $body.get("count")
$userList = $body.get("items") |
Системные функции
sys.sleep(microseconds int)
...