latestSwagger 2.02026-08-101561322.2 MB

3e4029d19684

Chats

Get a single chat

<a class="try-sandbox-link" href="https://sandbox.textmagic.com/#/Chats/getChat" target="_blank">Try in sandbox</a><br>

get/api/v2/chats/{id}

Path parameters

idinteger required

Response

Returned when successful.

idinteger required

Chat ID.

originalIdinteger nullable required
phonestring required

Chat partner's phone number.

unsubscribedContactIdinteger nullable required

If this field has a value, it means that the chat phone number has been unsubscribed from you and this value is an ID of an Unsubscribed contact entity. See Get all unsubscribed contacts.

unreadinteger required

Total unread incoming messages.

updatedAtstring date-time required

Time when the last incoming message arrived at this chat.

status'a' | 'c' | 'd' required

Chat status:

  • a - Active;
  • c - Closed;
  • d - Deleted.
mute0 | 1 required

Indicates when the chat is muted.

lastMessagestring nullable required

The last message content of a chat.

direction'ci' | 'co' | 'i' | 'o' nullable required

Last message type:

  • ci - incoming call;
  • co - outgoing call;
  • i - incoming message;
  • o - outgoing message.
replyOptionsTypestring nullable required

Used for chats prices.

fromstring nullable required

If filled, the value will be used as a sender number for all outgoing messages of a chat.

mutedUntilstring date-time nullable required

Date and time until the chat will be muted.

timeLeftMuteinteger required

Time left untill the chat will be unmuted (seconds).

pinnedboolean nullable required

Indicates when the chat is pinned.

typestring required

Chat type.

smsPricenumber required
mmsPricenumber required
assigneeIdinteger nullable required
createdAtstring date-time required

Chat creation date and time.

messageTimestring date-time required

Chat last message date and time.

conversationEndedboolean nullable

Indicates whether the live chat conversation has ended. Null for non-live chats.

Example response

{
  "id": 43328,
  "originalId": 43328,
  "contact": {
    "id": 27074,
    "favorited": true,
    "blocked": true,
    "firstName": "Charles",
    "lastName": "Conway",
    "companyName": "Example Ltd.",
    "email": "charles@example.com",
    "country": {
      "id": "US",
      "name": "India"
    },
    "customFields": [
      {
        "id": 515,
        "userCustomFieldId": 515,
        "name": "Custom name",
        "value": "Custom value",
        "createdAt": "2015-02-11T07:33:19+0000"
      }
    ],
    "user": {
      "id": 305,
      "displayTimeFormat": "24h",
      "username": "charles.conway",
      "firstName": "Charles",
      "lastName": "Conway",
      "email": "charles@example.com",
      "status": "A",
      "balance": 208.64,
      "phone": "447860021130",
      "company": "Example Ltd.",
      "currency": {
        "id": "GBP",
        "unicodeSymbol": "£",
        "htmlSymbol": "&pound;"
      },
      "country": {
        "id": "US",
        "name": "India"
      },
      "timezone": {
        "id": 55,
        "area": "Europe",
        "dst": 1,
        "offset": 10800,
        "timezone": "Europe\\/Tallinn"
      },
      "subaccountType": "P",
      "emailAccepted": true,
      "phoneAccepted": true,
      "avatar": {
        "href": "avatars/lav5d8de21d89971646555094.png"
      }
    },
    "lists": [
      {
        "id": 715,
        "name": "Private list",
        "description": "Private contacts of C. R. Conway",
        "membersCount": 332,
        "user": {
          "id": 305,
          "displayTimeFormat": "24h",
          "username": "charles.conway",
          "firstName": "Charles",
          "lastName": "Conway",
          "email": "charles@example.com",
          "status": "A",
          "balance": 208.64,
          "phone": "447860021130",
          "company": "Example Ltd.",
          "currency": {
            "id": "GBP",
            "unicodeSymbol": "£",
            "htmlSymbol": "&pound;"
          },
          "country": {
            "id": "US",
            "name": "India"
          },
          "timezone": {
            "id": 55,
            "area": "Europe",
            "dst": 1,
            "offset": 10800,
            "timezone": "Europe\\/Tallinn"
          },
          "subaccountType": "P",
          "emailAccepted": true,
          "phoneAccepted": true,
          "avatar": {
            "href": "avatars/lav5d8de21d89971646555094.png"
          }
        },
        "avatar": {
          "href": "avatars/lav5d8de21d89971646555094.png"
        }
      }
    ],
    "owner": {
      "id": 305,
      "displayTimeFormat": "24h",
      "username": "charles.conway",
      "firstName": "Charles",
      "lastName": "Conway",
      "email": "charles@example.com",
      "status": "A",
      "balance": 208.64,
      "phone": "447860021130",
      "company": "Example Ltd.",
      "currency": {
        "id": "GBP",
        "unicodeSymbol": "£",
        "htmlSymbol": "&pound;"
      },
      "country": {
        "id": "US",
        "name": "India"
      },
      "timezone": {
        "id": 55,
        "area": "Europe",
        "dst": 1,
        "offset": 10800,
        "timezone": "Europe\\/Tallinn"
      },
      "subaccountType": "P",
      "emailAccepted": true,
      "phoneAccepted": true,
      "avatar": {
        "href": "avatars/lav5d8de21d89971646555094.png"
      }
    },
    "tags": [
      {
        "id": 23,
        "title": "Red"
      }
    ],
    "avatar": {
      "href": "avatars/lav5d8de21d89971646555094.png"
    },
    "notes": [
      {
        "id": 5,
        "createdAt": "2015-06-19T09:48:24+0000",
        "note": "Test note",
        "user": {
          "id": 305,
          "displayTimeFormat": "24h",
          "username": "charles.conway",
          "firstName": "Charles",
          "lastName": "Conway",
          "email": "charles@example.com",
          "status": "A",
          "balance": 208.64,
          "phone": "447860021130",
          "company": "Example Ltd.",
          "currency": {
            "id": "GBP",
            "unicodeSymbol": "£",
            "htmlSymbol": "&pound;"
          },
          "country": {
            "id": "US",
            "name": "India"
          },
          "timezone": {
            "id": 55,
            "area": "Europe",
            "dst": 1,
            "offset": 10800,
            "timezone": "Europe\\/Tallinn"
          },
          "subaccountType": "P",
          "emailAccepted": true,
          "phoneAccepted": true,
          "avatar": {
            "href": "avatars/lav5d8de21d89971646555094.png"
          }
        }
      }
    ]
  },
  "unsubscribedContactId": 546,
  "unread": 5,
  "updatedAt": "2015-01-08T06:13:21+0000",
  "lastMessage": "Hello world!",
  "replyOptionsType": "user_carrier_twilio",
  "mutedUntil": "2019-10-10T14:44:00+0000",
  "timeLeftMute": 17988,
  "country": {
    "id": "US",
    "name": "India"
  },
  "pinned": true,
  "type": "sms",
  "smsPrice": 12.34,
  "mmsPrice": 12.34,
  "tags": [
    {
      "id": 23,
      "title": "Red"
    }
  ],
  "assigneeId": 1,
  "updatedBy": {
    "id": 456,
    "firstName": "John",
    "lastName": "Smith",
    "avatarUrl": "https://example.com/avatar.jpg",
    "email": "john.smith@example.com"
  },
  "createdAt": "2015-01-08T06:13:21+0000",
  "messageTime": "2015-01-08T06:13:21+0000",
  "conversationEnded": true,
  "rating": {
    "rate": "good",
    "comment": "Great support!"
  }
}