Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Данные сессии отправляются в виде двоичных данных.

URL-адрес запроса

https://localhost:9092ccs-dev-api.cipher.kiev.ua/ccs/hash/api/v1/ticketcontext/{uuidcontextId}/data

Метод

POST

Параметры запроса
uuid
contextIdStringfalseИдентификатор сессии
Настраиваемые заголовки запроса
Content-Typeapplication/octet-stream
Ответ
Код ответаContent-typeДопустимые параметрыПример содержимого
200application/json
message

{
    "message" : "Данные для сессии успешно загружены.",
}



503application/jsonmessage
{
    "message" : "Сервис хранения данных не запущен."
}
400application/jsonmessage
{
    "message" : "Сессия отсутствует." 
}
500application/jsonmessage
failureCause 
{
    "message" : "Ошибка при загрузке данных для сессии.",
    "failureCause" : ""
}
Параметры JSON объекта ответа
ПараметрТип данныхОписание
messageStringОписание результата проведения операции
failureCause StringОписание причины возникновения ошибки
Пример кода на JavaScript + jQuery 2.2.4
Code Block
languagejs
$.ajax(var settings = {
    "url": "https:///localhost:9092ccs-dev-api.cipher.kiev.ua/ccs/hash/api/v1/ticketcontext/79343564cacba9d7-147f009c-4a2a4e5f-ac2aa6a0-182d7a55f802d1ff0497894a/data",
    type"method": "POST",
    contentType: "application/octet-stream",
    processData: false"timeout": 0,
    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;
    }
})

Данные сессии отправляются в виде двоичных данных.

URL-адрес запроса

https://localhost:9092/api/v1/ticket/{uuid}/data

Метод

POST

Параметры запроса
uuidStringИдентификатор сессии
Настраиваемые заголовки запроса
Content-Typeapplication/octet-stream
Ответ
Код ответаContent-typeДопустимые параметрыПример содержимого
200application/jsonmessage

{
    "message" : "Данные для сессии успешно загружены.",
}

503application/jsonmessage

{
    "message" : "Сервис хранения данных не запущен."
}

400application/jsonmessage{
    "message" : "Сессия отсутствует."
}
500application/jsonmessage
failureCause 
{
    "message" : "Ошибка при загрузке данных для сессии.",
"failureCause" : ""
}
Параметры JSON объекта ответа
ПараметрТип данныхОписание
messageStringОписание результата проведения операции
failureCause StringОписание причины возникновения ошибки
Пример кода на JavaScript + jQuery 2.2.4
Code Block
languagejs
$.ajax({
    url: "https://localhost:9092/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;
    }
})"headers": {
    "Content-Type": ["application/octet-stream", "application/msword"]
  },
   "data": "<file contents here>"
};

$.ajax(settings).done(function (response) {
  console.log(response);
});