JSON API » messages » messages/list

Gets array of fields of messages.

Input parameters

Requires authentication and the features, messages, or user role privileges.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
mailboxStringMailbox containing messages.Yes
folderStringFolder containing messages. Most commonly "INBOX".Yes
callerStringOnly return messages with callerid or caller name containing this string. Empty string for all.NoEmpty string.
customerIntegerID of customer owning mailbox.NoCustomer of authentication user.
duration_maximumIntegerOnly return messages less than or equal to this duration in seconds. -1 for no limit. Affects voicemails only.No-1
duration_minimumIntegerOnly return messages greater than or equal to this duration in seconds. Affects voicemails only.No0
endIntegerOnly return messages received before this Unix timestamp.NoNow.
startIntegerOnly return messages received at or after this Unix timestamp.No0
typeStringOnly return messages of given type. "fax", "text", "voicemail", or empty string for any.NoEmpty string.
sortStringField to sort by. "caller", "duration", "time", or empty string for unsorted.NoEmpty string.
descendingInteger1 to sort descending, 0 not to.No0

Responses

CodeDescription
200Success.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
404The mailbox or message does not exist.

Data returned

An array of fields, corresponding to the messages. The message files are not included.

Example: With required parameters

http://enswitch.example.com/api/json/messages/list/?auth_username=user;auth_password=password;mailbox=1234;folder=INBOX

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "name":"msg0001", "time":1234567890, ... }, { "name":"msg0002", "time":1234567891, ... } ] }

Change history

VersionChanges
3.15"text" value added to type input parameter.
3.14end input parameter changed to return data < value instead of <= value.
3.13Function added.