Threads

The Thread resource allows you to:

  • Collect a user’s conversation threads via GET

Viewing Threads

To collect a thread for a user you make a GET request to the Thread resource:

https://api.sendhub.com/v1/threads/THREADID/?username=USERNAME&api_key=APIKEY

Where THREADID (and the full path) is obtained from the ‘resource_uri’ value in the Inbox response.

If your request is valid, you’ll get a 200 Ok status and a data response similar to this:

{
   "meta": {
      "limit": 10,
      "next": null,
      "offset": 0,
      "previous": null,
      "total_count": 3
   },
   "objects": [
      {
         "contacts": [
            {
               "id": 1111,
               "name": "John Doe"
            }
         ],
         "groups": null,
         "id": "23",
         "resource_uri": "/api/v1/messages/23/",
         "scheduled_at": null,
         "sent": "2012-02-17T20:19:16.192747",
         "text": "Inbound message test",
         "unread": false
      },
      {
         "contacts": [
            {
               "id": 1111,
               "name": "John Doe"
            }
         ],
         "groups": null,
         "id": "24",
         "resource_uri": "/api/v1/messages/24/",
         "scheduled_at": null,
         "sent": "2012-02-17T20:29:22.978898",
         "text": "Outbound test message",
         "unread": null
      },
      {
         "contacts": [
            {
               "id": 1111,
               "name": "John Doe"
            }
         ],
         "groups": null,
         "id": "25",
         "resource_uri": "/api/v1/messages/25/",
         "scheduled_at": null,
         "sent": "2012-02-17T20:36:36.639968",
         "text": "Testing",
         "unread": null
      }
   ]
}

Available Fields:

All fields in the Profile resource are read only.

Name Explanation
limit The number of messages displayed on a page.
next The path to the next page of the thread, if available.
offset The starting message for the current page.
previous The path to the previous page of the thread, if available.
objects The list of messages in this thread.