Link Search Menu Expand Document

Updated Fri Jun 18th 2021, 16:17 UTC

Conversations

GET /contacts/:contact/conversations

A single Contact may have had Conversations with different Users across your Accounts.

Examples

Get Conversations

Request

GET /contacts/DQeeO69/conversations
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
    -H Authorization:"Bearer {token}" \
    -X GET /contacts/DQeeO69/conversations
    

Response

Status

200

Response Type

ConversationCollection

Example
{
  "@type": "ConversationCollection",
  "@context": "/contexts/ConversationCollection.jsonld",
  "id": "/contacts/DQeeO69/conversations",
  "members": [
    {
      "@type": "ConversationWithAccount",
      "@context": "/contexts/ConversationWithAccount.jsonld",
      "id": "/conversations/Pvwqm5G",
      "phoneNumber": "+13035555678",
      "formattedPhoneNumber": "(303) 555-5678",
      "slug": "Pvwqm5G",
      "currentState": "open",
      "unanswered": false,
      "unsubscribed": false,
      "blocked": false,
      "account": {
        "@type": "Account",
        "@context": "/contexts/Account.jsonld",
        "id": "/accounts/my_account",
        "name": "Example Account"
      },
      "latestPreviewableItem": {
        "@type": "Message",
        "id": "/messages/06oyogE",
        "@context": "/contexts/Message.jsonld",
        "direction": "in",
        "body": "He once made a weeping willow laugh",
        "formattedBody": "<div>He once made a weeping willow laugh</div>",
        "deliveryState": "received",
        "displayTimestamp": "2018-07-24T20:59:32.156Z",
        "timelinePosition": "2018-07-24T20:59:32.156Z",
        "conversation": "/conversations/JYnJBY",
        "sender": null,
        "attachments": {
          "@context": "/contexts/hydra:Collection.jsonld",
          "@type": "hydra:Collection",
          "id": "/messages/joZqVWd/attachments",
          "members": [],
          "totalItems": 0
        },
        "friendlyStateDescription": "Inbound Message Received",
        "retryAllowed": false,
        "retry": null,
        "latestEventAt": "2018-07-24T20:59:32.156Z",
        "flags": []
      },
      "nextScheduledMessage": null,
      "requestingUserInfo": {
        "@type": "ConversationUserInfo",
        "@context": "/contexts/ConversationUserInfo.jsonld",
        "id": "/conversations/Pvwqm5G/user_info",
        "read": false,
        "readToTimelinePosition": null,
        "starred": false,
        "assigned": true
      },
      "participants": "/conversations/Pvwqm5G/participants",
      "assignedContact": {
        "@type": "Contact",
        "@context": "/contexts/Contact.jsonld",
        "id": "/contacts/DQeeO69",
        "name": "TextUs Contact",
        "firstName": "TextUs",
        "lastName": "Contact",
        "phones": {
          "@type": "Collection",
          "@context": "/contexts/hydra:Collection.jsonld",
          "id": "/contacts/DQeeO69/phones",
          "members": [
            {
              "@type": "ContactPhone",
              "@context": "/contexts/ContactPhone.jsonld",
              "id": "/contact_phones/mxvbRw",
              "phoneNumber": "+13035551234",
              "formattedPhoneNumber": "(303) 555-1234",
              "extension": null,
              "type": "Mobile",
              "deliverabilityStatus": "unknown",
              "contact": "/contacts/DQeeO69"
            },
            {
              "@type": "ContactPhone",
              "@context": "/contexts/ContactPhone.jsonld",
              "id": "/contact_phones/KMrEB8w",
              "phoneNumber": "+13035555678",
              "formattedPhoneNumber": "(303) 555-5678",
              "extension": null,
              "type": "Mobile",
              "deliverabilityStatus": "unknown",
              "contact": "/contacts/DQeeO69"
            },
            {
              "@type": "ContactPhone",
              "@context": "/contexts/ContactPhone.jsonld",
              "id": "/contact_phones/1DwXpOq",
              "phoneNumber": "+13038675309",
              "formattedPhoneNumber": "(303) 867-5309",
              "extension": null,
              "type": "Mobile",
              "deliverabilityStatus": "unknown",
              "contact": "/contacts/DQeeO69"
            }
          ],
          "totalItems": 3
        },
        "notes": "/contacts/DQeeO69/notes",
        "conversations": "/contacts/DQeeO69/conversations",
        "data": {},
        "createdAt": "2020-01-06T21:49:58.312Z"
      },
      "associatedContacts": "/conversations/Pvwqm5G/associated_contacts",
      "readConversation": "/conversations/Pvwqm5G/read",
      "unreadConversation": "/conversations/Pvwqm5G/read",
      "starConversation": "/conversations/Pvwqm5G/star",
      "unstarConversation": "/conversations/Pvwqm5G/star",
      "reopenConversation": null,
      "closeConversation": "/conversations/Pvwqm5G/close",
      "blockConversation": "/conversations/Pvwqm5G/block",
      "unblockConversation": null,
      "subscribeConversation": null,
      "unsubscribeConversation": "/conversations/Pvwqm5G/subscribe",
      "timeline": "/conversations/Pvwqm5G/timeline",
      "stats": "/conversations/Pvwqm5G/stats",
      "assignments": "/conversations/JYnJBY/assignments",
      "assignContact": "/conversations/Pvwqm5G/assign_contact"
    }
  ],
  "totalItems": 1,
  "view": {
    "@type": "hydra:PartialCollectionView",
    "@context": "/contexts/hydra:PartialCollectionView.jsonld",
    "id": "/contacts/DQeeO69/conversations",
    "first": "/contacts/DQeeO69/conversations",
    "next": null,
    "previous": null
  }
}

© 2021 TextUs