Get/allMessages

The get/allMessages method returns a list of all SMS, fax, and voicemail messages received or sent for a particular mailbox. 


The response includes the following fields of information:


For SMS messages-


  • id - a particular identification number for the SMS message. 
  • idx
  • new - a value of 1 indicates that the message is new.
  • 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
  • receiver - phone number for the receiver
  • time - the time the message was received or sent, in Unix time code.
  • msgdata - the actual text of the message.
  • 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, if any.
  • seen - indicates if the user has seen the notice about the message. Think of this as an email attachment. A user can open the email containing the attachment and than the attachment is seen by him as being available. Once he actually opens it will also be indicated as read by him.
  • lid


For voicemail messages-


  • id - a particular number identifying the message.
  • time - the time the message was recorded (in Unix timestamp 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 SMS message. 
  • time - the time the document was received or sent, in Unix time code.
  • pages - number of pages for the document.
  • mailbox - the mailbox associated with the document.
  • called - the phone number that was dialed for the fax (it'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 file for the fax document 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, if any.
  • seen - indicates if the user has seen the notice about the message. Think of this as an email attachment. A user can open the email containing the attachment and than the attachment is seen by him as being available. Once he actually opens it will also be indicated as read by him.


Parameters


Parameter
Type
Operation
sms_line
string
Indicate the number for the SMS line for which you want to have the list of messages.
descending
Boolean
Use value of 1 with this parameter to sort the list in descending order
*start
integer
The  starting time for displaying the messages in Unix timestamp.
*end
integer
The ending time for displaying the messages in Unix timestamp.
limit
integer
Specify the number of messages to be returned by the request.
offset
integer
Specify the first message to display. For example an offset of 3 will start the list on the 3rd message. If left empty the default will be the first record.


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


Example


To get a list of fax documents for mailbox 1-646-741-5150 use the following syntax:


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


Result:


.

.

.

    {

        error":null,
        "result":{
        "sms":[
            {
            "id":"19178884435",
            "idx":"6",
            "new":"0",
            "direction":"out",
            "sender":"1646801470",
            "receiver":"19178884435",
            "time":"1512318577",
            "msgdata":"the specs for the project look good",
            "sent_by":"13697",
            "read_by":"",
            "seen":"0",
            "lid":"2567965"
            }
            ],
        "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.