Запрос для получения ЭЦП в виде двоичных данных.
https://local.cipher.kiev.ua:9091/api/v1/ticket/{uuid}/data
GET
uuid | String | Идентификатор сессии |
Отсутствуют
Код ответа | Content-type | Допустимые параметры | Пример содержимого |
---|---|---|---|
200 | application/octet-stream |
| |
503 | application/json | message | { |
400 | application/json | message | { "message" : "Сессия отсутствует." } |
Параметр | Тип данных | Описание |
---|---|---|
message | String | Описание результата проведения операции |
var xhr = new XMLHttpRequest(); var requestUrl = "https://local.cipher.kiev.ua:9091/api/v1/ticket/79343564-147f-4a2a-ac2a-182d7a55f802/data"; 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(); |