Link Search Menu Expand Document

Updated Fri Mar 5th 2021, 12:17 UTC

Conversation

GET /:account/conversations/:phone_number

A Conversation is a series of messages exchanged between a Contact and one or more Users.

Examples

Getting the conversation by phone number

Request

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

Response

Status

200

Response Type

Conversation

Example
{
  "@type": "Conversation",
  "id": "/conversations/kY1QwY",
  "@context": "/contexts/Conversation.jsonld",
  "slug": "kY1QwY",
  "currentState": "open",
  "account": "/accounts/sanford.llc",
  "requestingUserInfo": "/conversations/kY1QwY/user_info",
  "phoneNumber": "+13035551234",
  "formattedPhoneNumber": "(303) 555-1234",
  "assignedContact": null,
  "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": []
  },
  "associatedContacts": {
    "@type": "ContactCollection",
    "id": "/conversations/kY1QwY/associated_contacts",
    "@context": "/contexts/hydra:Collection.jsonld",
    "totalItems": 1,
    "members": [
      {
        "@type": "Contact",
        "id": "/contacts/zdtK3c",
        "@context": "/contexts/Contact.jsonld",
        "name": "Chuck Norris",
        "firstName": "Chuck",
        "lastName": "Norris",
        "data": {},
        "phones": {
          "@type": "hydra:Collection",
          "id": "/contacts/DQeeO69/phones",
          "@context": "/contexts/hydra:Collection.jsonld",
          "totalItems": 3,
          "members": [
            {
              "@type": "ContactPhone",
              "id": "/contact_phones/mxvbRw",
              "@context": "/contexts/ContactPhone.jsonld",
              "phoneNumber": "+13035551234",
              "formattedPhoneNumber": "(303) 555-1234",
              "extension": null,
              "type": "Mobile",
              "deliverabilityStatus": "unknown",
              "contact": "/contacts/DQeeO69"
            }
          ]
        },
        "notes": {
          "@type": "hydra:Collection",
          "id": "/contacts/DQeeO69/notes",
          "@context": "/contexts/hydra:Collection.jsonld",
          "totalItems": 0,
          "members": []
        },
        "conversations": "/contacts/DQeeO69/conversations",
        "createdAt": "2020-01-06T21:49:58.312Z"
      }
    ]
  },
  "participants": {
    "@type": "hydra:Collection",
    "id": "/conversations/kY1QwY/participants",
    "@context": "/contexts/hydra:Collection.jsonld",
    "totalItems": 1,
    "members": [
      {
        "@type": "User",
        "@context": "/contexts/User.jsonld",
        "id": "/users/wqyODPA",
        "name": "Chuck Norris",
        "firstName": "Chuck",
        "lastName": "Norris",
        "email": "chuck@textus.example",
        "avatar": null,
        "automatedActor": false,
        "hasPassword": false,
        "discarded": false,
        "settings": {
          "notifications": {
            "email": true
          },
          "customSettings": {}
        },
        "memberships": "/users/wqyODPA/memberships"
      }
    ]
  },
  "assignments": "/conversations/kY1QwY/assignments",
  "assignContact": "/conversations/kY1QwY/assign_contact",
  "reopenConversation": null,
  "closeConversation": "/conversations/kY1QwY/close",
  "readConversation": "/conversations/kY1QwY/read",
  "unreadConversation": "/conversations/kY1QwY/read",
  "starConversation": "/conversations/kY1QwY/star",
  "unstarConversation": "/conversations/kY1QwY/star",
  "blockConversation": "/conversations/Pvwqm5/block",
  "unblockConversation": null,
  "subscribeConversation": null,
  "unanswered": false,
  "unsubscribeConversation": "/conversations/Pvwq8zp/subscribe",
  "unsubscribed": false,
  "timeline": {
    "@type": "hydra:Collection",
    "id": "/conversations/kY1QwY/timeline",
    "@context": "/contexts/hydra:Collection.jsonld",
    "totalItems": 3,
    "members": [
      {
        "@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": []
      },
      {
        "@type": "Message",
        "id": "/messages/QNDkpL",
        "@context": "/contexts/Message.jsonld",
        "direction": "out",
        "body": "Chuck Norris doesn't use web standards as the web will conform to him.",
        "formattedBody": "<div>Chuck Norris doesn't use web standards as the web will conform to him.</div>",
        "displayTimestamp": "2018-07-24T20:59:32.156Z",
        "timelinePosition": "2018-07-24T20:59:32.156Z",
        "deliveryState": "delivered",
        "conversation": "/conversations/kY1QwY",
        "sender": "/users/hikvlD",
        "attachments": {
          "@context": "/contexts/hydra:Collection.jsonld",
          "@type": "hydra:Collection",
          "id": "/messages/joZqVWd/attachments",
          "members": [],
          "totalItems": 0
        },
        "friendlyStateDescription": "Message Delivered",
        "retryAllowed": false,
        "retry": null,
        "latestEventAt": "2018-07-24T20:59:32.156Z",
        "flags": []
      },
      {
        "@type": "ConversationEvent",
        "id": "/conversation_events/Pvwqm5G",
        "@context": "/contexts/ConversationEvent.jsonld",
        "type": "open",
        "displayTimestamp": "2018-10-30T21:01:43.498Z",
        "timelinePosition": "2018-10-30T21:01:43.498Z",
        "conversation": "/conversations/Pvwqm5G",
        "user": null,
        "assignee": null
      }
    ],
    "view": {
      "@context": "/contexts/hydra:PartialCollectionView.jsonld",
      "@type": "hydra:PartialCollectionView",
      "id": "/conversations/kY1QwY/timeline",
      "first": "/conversations/kY1QwY/timeline",
      "next": null,
      "previous": null
    }
  },
  "blocked": false,
  "stats": "/conversations/Pvwqm5G/stats"
}

© 2021 TextUs