1. Telebroad | Support Center
  2. Solution home
  3. Legacy API Documentation
  4. REST API - GET Requests
Open navigation

GET/sms/conversation (Legacy)

  Articles in this support section discuss Telebroad's legacy APIs. To learn about the current version of Telebroad APIs, which offer additional authentication options and support for advanced features, please go to https://developers.telebroad.com/.


The specific current version of the GET/sms/conversation API is covered here.



Function and Response Fields


  Note the distinction between this API and the GET/sms/conversations request, which returns details for all conversations of a phone line.


The GET/sms/conversation method returns details about a particular SMS conversation for a telephone line, displaying all the messages exchanged in the conversation. The response has the following fields:


  • ID- a unique ID of each message in the flow of the conversation. 
  • new -  1 indicates a new message and a value of  0 indicates an old one.
  • direction - the direction traveled by the messages. Either "in" or "out". 
  • sender - the number of the sender of the message.
  • receiver - the number of the receiver of the message.
  • time - the time the message was sent or received in Unix time format.
  • msgdata - the actual content of an SMS message.
  • Media - link to any media (picture, video, audio) attached to the message.
  • read -   a value of 1 indicates that the text of the message was read. 0 indicates it has not.
  • read_by - a system ID of the user who read the message, if any.
  • sent_by - a system ID  of the user who sent the message.
  • seen - not used at the moment (always 0), but will be implemented in the future to indicate MMS media in the message (such as audio or video) has been opened and seen by the user.

Parameters


All parameters go in the header.


ParameterTypeOperation
sms_linestringThe SMS line from which the list of messages is requested.

You can get this from the GET/sms/lines request.
conversationstring
The ID for the conversation for which the details are requested – based on the other party's number.

You obtain this ID using the GET/sms/conversations request.
limit
integer
(optional) Specify the number of messages to be returned by the request.
offset
integer
(optional) Specify the first record to display. An offset of 0 displays the first conversation. So, for example, an offset of 2 will start the list on the 3rd conversation. If left empty, the default will be the first conversation.

Example


To get the details of the conversation for SMS line 646-741-5360 with party with the number 1-917-580-4880, use this syntax:


HTTPS method: GET


webserv.telebroad.com/api/teleconsole/rest/sms/conversation?sms_line=16467415360&conversation=19175804880


Response:


If the conversation doesn't exist, an error is not returned but just an empty "result" container -


{ 

    "error": null, 

    "result": [] 

}


Otherwise - 


{ 

    "error": null,

        "result": [

            { 

            "id": 4023180,
            "new": 0,

            "direction": "in",

            "sender": 19175804880,

            "receiver": 16466991371,

            "time": 1584609452,

            "msgdata": "I like your latest design!",

            "media": [],

            "read": 1,

            "read_by": ",13690",

            "sent_by": 0,

            "seen": 0 }, 

            {

            "id": 4023178,

            "new": 0,

            "direction": "out",

            "sender": 16466991371,

            "receiver": 19175804880,

            "time": 1584609234,

            "msgdata": "Excellent!",

            "media": [],

            "read": 1,

            "read_by": ",13690",

            "sent_by": 13690,

            "seen": 0 },

            {

            "id": 4023176,

            "new": 0,

            "direction": "in",

            "sender": 19175804880

            "receiver": 16466991371,

            "time": 1584608805,

            "msgdata": "What's your take on this overlay?...",

            "media": [ "https:\/\/mmscdn.blob.core.windows.net\/

            ljafrjb\/0a3b8e9f-a65c-4ea7-9e7b-8af869bc2440.jpeg" ],

            "read": 1,

            "read_by": ",13690",

            "sent_by": 0,

            "seen": 0 }

    ]

}