Данные сессии отправляются в виде двоичных данных.
URL-адрес запроса
https://localhost:9092ccs-dev-api.cipher.kiev.ua/ccs/hash/api/v1/ticketcontext/{uuidcontextId}/data
Метод
POST
Параметры запроса
uuidcontextId | String | false | Идентификатор сессии |
Настраиваемые заголовки запроса
Content-Type | application/octet-stream |
Ответ
Код ответа | Content-type | Допустимые параметры | Пример содержимого |
---|
200 | application/json |
message{ "message" : "Данные для сессии успешно загружены.", } |
|
|
503 | application/json | message | { "message" : "Сервис хранения данных не запущен." } |
400 | application/json | message | { "message" : "Сессия отсутствует." } |
500 | application/json | message failureCause | { "message" : "Ошибка при загрузке данных для сессии.", "failureCause" : "" } |
Параметры JSON объекта ответа
Параметр | Тип данных | Описание |
---|
message | String | Описание результата проведения операции |
failureCause | String | Описание причины возникновения ошибки |
Пример кода на JavaScript + jQuery 2.2.4
Code Block |
---|
|
$.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
Параметры запроса
uuid | String | Идентификатор сессии |
Настраиваемые заголовки запроса
Content-Type | application/octet-stream |
Ответ
Код ответа | Content-type | Допустимые параметры | Пример содержимого |
---|
200 | application/json | message | { "message" : "Данные для сессии успешно загружены.", } |
503 | application/json | message | { "message" : "Сервис хранения данных не запущен." } |
400 | application/json | message | { "message" : "Сессия отсутствует." } |
500 | application/json | message failureCause | { "message" : "Ошибка при загрузке данных для сессии.", "failureCause" : "" } |
Параметры JSON объекта ответа
Параметр | Тип данных | Описание |
---|
message | String | Описание результата проведения операции |
failureCause | String | Описание причины возникновения ошибки |
Пример кода на JavaScript + jQuery 2.2.4
Code Block |
---|
|
$.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);
}); |