JSON API » messages » messages/list
Gets array of fields of messages.
Input parameters
Requires authentication and the features, messages, or user role privileges.
| Name | Type | Description | Required | Default value |
|---|---|---|---|---|
| auth_username | String | Authentication username. | Yes | |
| auth_password | String | Authentication password. | Yes | |
| mailbox | String | Mailbox containing messages. | Yes | |
| folder | String | Folder containing messages. Most commonly "INBOX". | Yes | |
| caller | String | Only return messages with callerid or caller name containing this string. Empty string for all. | No | Empty string. |
| customer | Integer | ID of customer owning mailbox. | No | Customer of authentication user. |
| duration_maximum | Integer | Only return messages less than or equal to this duration in seconds. -1 for no limit. Affects voicemails only. | No | -1 |
| duration_minimum | Integer | Only return messages greater than or equal to this duration in seconds. Affects voicemails only. | No | 0 |
| end | Integer | Only return messages received before this Unix timestamp. | No | Now. |
| start | Integer | Only return messages received at or after this Unix timestamp. | No | 0 |
| type | String | Only return messages of given type. "fax", "text", "voicemail", or empty string for any. | No | Empty string. |
| sort | String | Field to sort by. "caller", "duration", "time", or empty string for unsorted. | No | Empty string. |
| descending | Integer | 1 to sort descending, 0 not to. | No | 0 |
Responses
| Code | Description |
|---|---|
| 200 | Success. |
| 400 | Invalid input parameters specified. Check the key and message fields for more details. |
| 401 | The authentication details provided are invalid. |
| 402 | Your role does not allow this. |
| 404 | The 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
| Version | Changes |
|---|---|
| 3.15 | "text" value added to type input parameter. |
| 3.14 | end input parameter changed to return data < value instead of <= value. |
| 3.13 | Function added. |
