Page tree

Versions Compared

Key

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

...

Code Block
HTTP/1.1 200 OK
Server: nginx/1.11.13
Date: Fri, 09 Feb 2018 10:16:21 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Accept, Accept-Encoding, Accept-Language, Access-Control-Request-Headers, Access-Control-Request-Method, Authorization, Cache-Control, Connection, Content-Type, Cookie, Host, Origin, Pragma, Referer, X-Requested-With, User-Agent
Access-Control-Allow-Methods: GET, HEAD, POST, OPTIONS
Access-Control-Allow-Origin: http://dev.iqstore.ru
Pragma: no-cache
Cache-Control: private, must-revalidate
Content-Encoding: gzip


{
  "OK": true,
  "Error": null,
  "Result": [
    {
      "Id": 252,
      "ChatId": 10,
      "LocalId": 1498085875116,
      "EventId": 1649,
      "TicketMessageId": null,
      "Author": "client",
      "ClientId": 11,
      "UserId": null,
      "Payload": "text",
      "Text": "Здравствуйте!",
      "Received": true,
      "Read": true,
      "Pushed": false,
      "CreatedAt": 1498085875206,
      "ReceivedAt": 1498085920218,
      "ReadAt": 1498085920218,
      "My": true
    },
    {
      "Id": 253,
      "ChatId": 10,
      "LocalId": 1498085875247,
      "EventId": 1626,
      "TicketMessageId": null,
      "Author": "system",
      "ClientId": null,
      "UserId": null,
      "Payload": "notice",
      "Text": "",
      "Received": false,
      "Read": false,
      "Pushed": false,
      "CreatedAt": 1498085875247,
      "ReceivedAt": null,
      "ReadAt": null,
      "My": false
    },
    {
      "Id": 254,
      "ChatId": 10,
      "LocalId": 1498085879130,
      "EventId": 1633,
      "TicketMessageId": null,
      "Author": "user",
      "ClientId": null,
      "UserId": 4,
      "Payload": "text",
      "Text": "Добрый день!",
      "Received": true,
      "Read": true,
      "Pushed": false,
      "CreatedAt": 1498085879130,
      "ReceivedAt": 1498085879272,
      "ReadAt": 1498085879302,
      "My": false
    }
  ],
  "Rels": {
    "Clients": [
      {
        "Id": 11,
        "ProjectId": 1,
        "CompanyId": 2,
        "Type": "crm",
        "Name": "Дмитрий Менделеев",
        "Online": true,
        "CustomerId": 5,
        "ChannelId": null,
        "TelegramId": null,
        "FacebookId": null,
        "VKId": null,
        "TotalTickets": 2,
        "TotalOpenTickets": 1,
        "CreatedAt": 1498085866873,
        "UpdatedAt": 1518171379854,
        "SeenAt": 1518171379854,
        "MessagedAt": null,
        "IntegrationId": "10"
      }
    ],
    "Files": [
      {
        "Id": "1705a928-0d7a-11e8-b187-13b6ccbb5d10.txt",
        "Type": "file",
        "Owner": "client",
        "OwnerClientId": 11,
        "ClientId": null,
        "UserId": 1,
        "Name": "oci8-sigsegv.txt",
        "Path": "clients/11/11/1705a928-0d7a-11e8-b187-13b6ccbb5d10.txt",
        "Size": 5356,
        "ImageWidth": null,
        "ImageHeight": null,
        "ContentType": "",
        "CreatedAt": 1518167865822
      }
    ],
    "Users": [
      {
        "Id": 1,
        "Name": "Иван Коробков",
        "Email": "i.korobkov@iqstore.ru",
        "Position": "Технический директор",
        "RoleId": 1,
        "AvatarId": "e83220a3-56cb-11e7-b21f-6109cf735b0f.png",
        "Online": true,
        "Deleted": false,
        "TotalAssignedTickets": 1,
        "CreatedAt": 1491321126034,
        "UpdatedAt": 1518171379292,
        "LastSeenAt": 1518171379292,
        "AssignedAt": 1518166787715,
        "DisplayName": "Иван Коробков"
      }
    ]
  }
}

Авторизация запросов

Для авторизации запросов к серверу используется токен сессии, который клиент получает после авторизации во внешней системе. Токен автоматически проставляется в Cookie. Если нужно, его также можно передавать отдельным заголовком Authorization.

...