Данные сессии отправляются ЭЦП будут получены в виде двоичных данных.
URL-адрес запроса
https://local.cipher.kiev.ua:9091/api/v1/ticket/{uuid}/data
Метод
POSTGET
Параметры запроса
uuid | String | Идентификатор сессии |
Настраиваемые заголовки запроса
Content-Type | application/octet-stream |
Отсутствуют
Ответ
Код ответа | Content-type | Допустимые параметры | Пример содержимого | ||||
---|---|---|---|---|---|---|---|
200 | application/jsonoctet-stream | message |
| ||||
{ | 503 | application/json | message | { | |||
400 | application/json | message | { "message" : "Сессия отсутствует." } | 500 | application/json | message failureCause | { |
Параметры JSON объекта ответа
Параметр | Тип данных | Описание | |||
---|---|---|---|---|---|
message | String | Описание результата проведения операции | failureCause | StringОписание причины возникновения ошибки |
Пример кода на JavaScript
...
Code Block | ||
---|---|---|
| ||
$.ajax({ url: 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 = type: "POST",function() { contentType: "application/octet-stream", if (xhr.status == 200) { processData: false, dsData data: rawData }).done(function (jsonResponse, textStatus, xhr) { = xhr.response; message = jsonResponse.message; }).fail(function (xhr) { "Данные ЭЦП успешно получены."; } else { var reader = new FileReader(); reader.onload = function() { var response = reader.result; try { var jsonResponse = JSON.parse(xhr.responseText); message = jsonResponse.message; failureCause = jsonResponse.failureCause; } catch (e) { message = (xhr.responseText == undefined) ? "Ошибка при загрузкеполучении данных сессииЭЦП." : xhr.responseText; } } reader.readAsText(xhr.response); } }; xhr.send(); |