Get/allMessages

The GET/allMessages (case sensitive!) request returns a list of SMS, fax, and voicemail messages received or sent by a user. It essentially combines three separate Get requests into one request. 


The response includes the following fields of information:


For SMS messages -


  • id - caller ID number for the recipient or sender of the SMS, who is not the user.
  • 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.
  • 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 in

For voicemail messages -


  • id - a particular number identifying the message.
  • time - the time the message was recorded in Unix time format.
  • duration - its duration (in seconds).
  • mailbox - the number of the mailbox the message was left on.
  • caller - the number of the caller.
  • callerid - the caller ID of the caller.
  • callerid_ext - the extension of the caller (if call was internal).
  • name - the file name of the voicemail - this name is generated by the system and is important for obtaining more information with the get/voicemail/file method.
  • dir - the directory of the message (either INBOX or SENT).
  • read_by - the name of the user who read (listened to) the message, if any.

For fax documents -


  • id - a particular identification number for the fax document message. 
  • time - the time the document was received or sent, in Unix time format.
  • pages - number of pages for the document.
  • mailbox - the mailbox associated with the document (where it was received or sent from).
  • called - the phone number that was called as the fax's destination.
  • caller - the phone number of the caller (sender) of the document.
  • callerid - the caller ID of the sender (usually the same as caller.)
  • name - the name of the document fax file as it is stored on the Telebroad server. This is useful for the get/fax/message method for obtaining more information about the document.
  • dir - the directory where the document resides, either "INBOX" or "SENT".
  • sent_by - a name or ID (such as an extension) of the user who sent the document.
  • read_by - name or ID (such as an extension) of the user who read the message about the fax, if any.
  • seen - indicates if the user has actually seen (opened) the fax, instead of just reading the message containing it.

Parameters


Parameter
Type
Operation
sms_line
string
(optional) If the user's account has more than one SMS line, this indicates the specific line for which to display messages.

You can get this from the GET/sms/lines request.
descending
Boolean
(optional) Use value of 1 with this parameter to sort the list in descending order
*start
integer
(optional) The  starting time for displaying the messages in Unix timestamp.
*end
integer
(optional) The ending time for displaying the messages in Unix timestamp.
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 record. So, for example, an offset of 2 will start the list on the 3rd record. If left empty the default will be the first record.

*Use start=0 and end=-1 to display all voicemails.

Example


To get SMS, fax, and voicemail messages for the user with selected SMS line 1-646-741-5150 and a limit of one message per message type use the following syntax:


HTTPS method: GET


webserv.telebroad.com/api/teleconsole/rest/allMessages?sms_line=16467415150&limit=1


Response:


If the  number specific for the SMS line is wrong: 


{

 error: 

        { code: 444, 

        message: "Invalid SMS Lines" 

}


Otherwise:


{

        error":null,
     

    "result":{
 
    "sms":[
        {

        "id":"19178886445",

        "lid": 1646741515,
       
"idx":"6",
       
"new":"0",
       
"direction":"out",
       
"sender":"1646741515",
       
"receiver":"19178886445",
       
"time":"1512318577",

        "msgdata":"the specs for the project look good",

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

                /lfpxcbb\/6c22a8b1-7fdb-4569-afd9-

                d987d49d70a7.pdf",

                "read": 1,

                "sent_by":"13690",

                "read_by":"13697",
     
            "seen":"1",
     
            }
     
        ],
     
"voicemail":[
        {

        "id": "5958165",

        "time": "1505418688",

        "duration": "3",

        "mailbox": "1113840",

        "caller": "MATTS PIZZA",

        "callerid": "16314738423",

        "callerid_ext": "16314738423",

        "name": "voicemail_1505418688_150541868614908555

            _28702_16314738423_3",

        "dir": "INBOX",

        "read_by": ""

        },
     
"fax":[
     
    {
       
"id":"3604696",
       
"time":"1484376960",
       
"pages":"1",
       
"mailbox":"16467501156",
       
"called":"16464367740",
       
"caller":"16467501156",
       
"callerid":"16467501156",
        "name":"fax_1484376960_1_14844367740

        _1646436740_13474367740",
     
    "dir":"SENT",
 
        "sent_by":"13697",
     
    "read_by":"",
 
        "seen":""
        },

    }
    ]

}

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.