Дані сесії відправляються у вигляді двійкових даних.
URL-адреса запиту
https://crypto.ccs.cipher.kiev.ua:9093/api/v1/ticket/{uuid}/data
Метод
POST
Параметри запиту
uuid | String | Ідентифікатор сесії |
Налаштовування заголовків запиту
Content-Type | application/octet-stream |
Відповідь
Код відповіді | Content-type | Допустимі параметри | Приклад вмісту |
---|---|---|---|
200 | application/json | message | { |
503 | application/json | message | { |
400 | application/json | message | { "message" : "Сесія відсутня." } |
500 | application/json | message failureCause | { |
Параметри JSON обʼєкт відповіді
Параметр | Тип даних | Опис |
---|---|---|
message | String | Опис результату проведення операції |
failureCause | String | Опис причини виникнення помилки |
Приклад коду на JavaScript + jQuery 2.2.4
$.ajax({ url: "https://crypto.ccs.cipher.kiev.ua:9093/api/v1/ticket/79343564-147f-4a2a-ac2a-182d7a55f802/data", type: "POST", contentType: "application/octet-stream", processData: false, data: rawData }).done(function (jsonResponse, textStatus, xhr) { message = jsonResponse.message; }).fail(function (xhr) { try { var jsonResponse = JSON.parse(xhr.responseText); message = jsonResponse.message; failureCause = jsonResponse.failureCause; } catch (e) { message = (xhr.responseText == undefined) ? "Помилка при завантаженні даних сесії." : xhr.responseText; } })