Chat

Required product: Switch Premium

Get a list of chats to or from one or more endpoints.

  1. Properties
  2. Get all chats
  3. Get a single chat by UUID

Chat properties

Name Description
answered_at
{"answered_at":"2014-10-10T02:48:48+02:00"}
The time the chat was answered in ISO-8601.
answered_by
{"answered_by":{"name":"John Smith","endpoint":"Employee#1"}}
Minimal representation of the employee that first answered the chat
uuid
{"uuid":"45981120-324b-0132-d3ef-14dae9edd21d"}
Unique ID.
ended_at
{"ended_at":"2014-10-10T02:48:48+02:00"}
The time the chat was hungup in ISO-8601.
endpoint
{"endpoint":"ChatReception#1"}
The endpoint the chat was made to.
from_email
{"from_email":"karsten@example.com"}
E-mail of the chatter.
from_name
{"from_name":"Karsten Chatter"}
Name representing the chatter.
started_at
{"started_at":"2014-10-10T02:48:48+02:00"}
The time the chat was received in ISO-8601.
state
{"state":"ringing"}
{"state":"missed"}
{"state":"ended"}
{"state":"answered"}
{"state":"new"}
The current status for ongoing chat or final status for ended chat.

Get all chats

List all chats to and from all numbers.

URL parameters

Name Description Example
endpoint Show chats to specified endpoint. ChatReception#2
state Show chats with specified status. answered
limit Number of chats to show.
default: 30, maximum: 100
10
started_at_gt_or_eq Show chats started at or after the specified time as ISO 8601. 2014-10-10T02:48:48+02:00
started_at_lt_or_eq Show chats started at or before the specified time as ISO 8601. 2014-10-10T02:48:48+02:00

Request

GET /api/v2/chats

Response

Status: 200 OK
{
  "chats": [
    {
      "uuid": "e54f5820-386d-0132-5bc3-14dae9edd21d",
      "endpoint": "ChatReception#1",
      "from_name": "Donald Duck",
      "from_mail": "donald@disney.dk",
      "started_at": "2014-03-21T13:59:04Z",
      "answered_at": "2014-03-21T13:59:07Z",
      "answered_by": {
        "endpoint": "Employee#2",
        "name": "Karsten Kollega"
      },
      "ended_at": "2014-03-21T13:59:59Z",
      "state": "answered"
    }
  ]
}

Get a single chat by UUID

Get a single chat by its UUID.

Request

GET /api/v2/chats/:uuid

Response

Status: 200 OK
{
  "chat": {
    "uuid": "e54f5820-386d-0132-5bc3-14dae9edd21d",
    "endpoint": "ChatReception#1",
    "from_name": "Donald Duck",
    "from_mail": "donald@disney.dk",
    "started_at": "2014-03-21T13:59:04Z",
    "answered_at": "2014-03-21T13:59:07Z",
    "answered_by": {
      "endpoint": "Employee#2",
      "name": "Karsten Kollega"
    },
    "ended_at": "2014-03-21T13:59:59Z",
    "state": "answered"
  }
}