Запит для отримання даних модифікованого ЕП у вигляді двійкових даних.
URL-адреса запиту
https://localhost:9094/api/v1/ticket/{uuid}/ds/modifiedData
Метод
GET
Параметри запиту
uuid | String | Ідентифікатор сесії |
Налаштовувані заголовки запиту
Відсутні
Відповідь
Код відповіді | Content-type | Допустимі параметри | Приклад вмісту |
---|
200 | application/octet-stream |
|
|
503 | application/json | message | { "message" : "Сервіс зберігання даних не запущено." } |
400 | application/json | message | { "message" : "Сесія відсутня." } |
Параметри JSON обʼєкта відповіді
Параметр | Тип даних | Опис |
---|
message | String | Опис результату проведення операціїʼ |
Прикла коду на JavaScript
Code Block |
---|
|
var xhr = new XMLHttpRequest();
var requestUrl = "https://localhost:9094/api/v1/ticket/79343564-147f-4a2a-ac2a-182d7a55f802/ds/modifiedData";
xhr.open("GET", requestUrl);
xhr.responseType = "blob";
xhr.onload = function() {
if (xhr.status == 200) {
dsData = xhr.response;
message = "Дані модифікованого ЕП успішно отримані.";
} else {
var reader = new FileReader();
reader.onload = function() {
var response = reader.result;
try {
var jsonResponse = JSON.parse(xhr.responseText);
message = jsonResponse.message;
} catch (e) {
message = (xhr.responseText == undefined) ? "Помилка при отриманні даних модифікованого ЕП." : xhr.responseText;
}
}
reader.readAsText(xhr.response);
}
};
xhr.send(); |