You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

?????? (?????????, ticket) ???????????? ????? ??????-????????, ???????????? ???????? ??????????? ???????? ???????????? ? ?????????????. ??? ?????? ? ?????????? ???????????? 128-?????? ???????? ???? xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, ??? x-?????(?????) ???????????????? ??????? ??????????.

URL-????? ???????

https://crypto.ccs.cipher.kiev.ua:9093/api/v1/ticket

?????

POST

????????? ???????

???????????

???????????? ????????? ???????

?????c????

?????
??? ??????Content-type?????????? ??????????????? ???????????
200application/jsonmessage
ticketUuid
{
    "message" : "??????? ??????.",
    "ticketUuid" : "79343564-147f-4a2a-ac2a-182d7a55f802"
}
503application/jsonmessage
{
"message" : "?????? ?????????? ????????????????? ???????? ?? ???????."
}
????????? JSON ??????? ??????
??????????? ??????????????
messageString???????? ?????????? ?????????? ????????
ticketUuidString????????????? ????????? ??????
?????? ???? ?? JavaScript + jQuery 2.2.4
$.ajax({
    url: "https://crypto.ccs.cipher.kiev.ua:9093/api/v1/ticket",
    type: "POST",
    dataType: "json"
}).done(function (jsonResponse, textStatus, xhr) {
    message = jsonResponse.message;
    uuid = jsonResponse.ticketUuid;
}).fail(function (xhr) {
    try {
        var jsonResponse = JSON.parse(xhr.responseText);
        message = jsonResponse.message;
    } catch (e) {
        message = (xhr.responseText == undefined) ? "?????? ??? ???????? ?????????." : xhr.responseText;
    }
})


  • No labels