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

GET/sms/conversation

Function


  Note the distinction between this and GET/sms/conversations that 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 of information:


  • ID- a unique ID of each message in the flow of the conversation. 
  • new -  a value of 1 indicates 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 are requested.

You can get this from the GET/sms/lines request.
conversationstringThe 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.
limitinteger(optional) Specify the number of messages to be returned by the request.
offsetinteger(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 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, just a 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 }

    ]

}