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

GET/sms/conversations

Note the distinction between this and GET/sms/conversation request that returns elaborate details for a single conversation.


The GET/sms/conversations request returns a list of all SMS conversations for a particular telephone line with each conversation containing the following fields of information:


  • id - caller ID number for the recipient or sender of the SMS, who is not the user. This is used for the get/sms/conversation request to see all messages in a conversation since the non-user caller ID can distinguish between this conversation while the user's own caller ID will be the same for all.
  • lid -  caller ID number for the user's account (local ID) - the SMS line he used for receiving or sending the SMS.
  • idx - a value of 1 (which is most cases) indicates existence or caller ID for either sender or recipient (at least one of them is not blocked.) 
  • new - a value of 1 indicates that the message is new. It becomes 0 after the user opens it.
  • direction - "out" if the message was sent outward by the user. "in" if the message was received by the user.
  • sender - phone number for the sender (mostly same as either id or lid unless a different caller ID is used from the actual SMS phone number.)
  • receiver - phone number for the receiver (mostly same as either id or lid unless a different caller ID is used from the actual SMS phone number.)
  • time - the time the message was received or sent, in Unix time format.
  • msgdata - the actual text of the message.

    Note that only the latest message in the conversation is shown. To see all messages use the GET/sms/conversation request.
  • 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.


Parameter
Type
Operation
sms_line
string(optional) If more than one SMS line is available for the account, the SMS  line from which the list of conversations are requested.

You can get this from the GET/sms/lines request.
limit 
string(optional) Specify the number of conversations 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 list of conversations for SMS line 646-741-5360 with a limit of 3 use this syntax:


HTTPS method: GET


webserv.telebroad.com/api/teleconsole/rest/sms/conversations?sms_line=16467415360&limit=3


Response:


If the wrong SMS line was specified - 


{

    "error": {

        "code": 444,

        "message": "Invalid SMS Lines"

}

}


Otherwise -


    "error": null, 

        "result": [ 

            { 

            "id": 13474367740, 

            "lid": 16466991371,

            "idx": 1, 

            "new": 0,

            "direction": "out",

            "sender": 16466991371,

            "receiver": 13474367740, 

            "time": 1584610243,

            "msgdata": "Report looks good!", 

            "media": [], 

            "read": 1, 

            "read_by": ",13690",

             "sent_by": 13690, 

            "seen": 0 },

             { 

            "id": 13102225454, 

            "lid": 19178644345, 

            "idx": 1, 

            "new": 1,

            "direction": "in", 

            "sender": 13102225454

            "receiver": 16466991371,

            "time": 1584609452, 

            "msgdata": "I have opening next Tuesday...", 

            "media": [], 

            "read": 0, 

            "read_by": "",

            "sent_by": 0,

            "seen": 0 }, 

            {

            "id": 17189734451,

            "lid": 16466991371,

            "idx": 1,

            "new": 0,

            "direction": "out",

            "sender": 16466991371,

            "receiver": 17189734451,

            "time": 1556011611,

            "msgdata": "See attached audio file of our conference from yesterday",

            "media": 

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

                /lffirbb\/496a45df-fd6f-4d48-94dc-       

                     d8b07e3dc3c5" ],

            "read": 1,

            "read_by": ",13690",

            "sent_by": 13690,

            "seen": 0 }

      ]

}  

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article