List all messages

GET https://api.plivo.com/v1/Account/{{auth_id}}/Message/?message_state=undelivered

This API can be used to fetch a list of message detail records (MDRs) based on a filter criteria. More information can be found here

ArgumentsDescriptionRequired/Conditional/Optional
subaccountUse this argument to filter for.
- Outbound messages sent using a specific sub-account's auth token.
- Inbound messages received on a phone number associated with a specific sub-account.
Optional
message_directionUse this argument to filter the results by message direction. The valid inputs are inbound and outbound.Optional
message_timeForms of this parameter can be used to filter outbound/inbound messages based on the time the message was initiated/received.
The timestamps are expected to in YYYY-MM-DD HH:MM[:ss[.uuuuuu]] format, and are considered to be in UTC timezone.
The filter can be used in the following five forms:
messagetime: Use this argument to filter for messages by the exact timestamp. The format expected is YYYY-MM-DD HH:MM:ss:uuuuuu. Eg: To get all messages that were sent/received at 2012-03-21 11:47:30.982811, use messagetime=2012-03-21 11:47:30.982811
messagetimegt: gt stands for greater than. Use this argument to filter for messages sent/received after a given time. Eg: To get all messages that were sent/received after 2012-03-21 11:47, use messagetimegt=2012-03-21 11:47
message_time
gte: gte stands for greater than or equal. Eg: To get all messages that were sent/received after or exactly at 2012-03-21 11:47[:30], use messagetimegte=2012-03-21 11:47[:30]
message
timelt: lt stands for lesser than. Use this argument to filter for messages sent/received before a given time. Eg: To get all messages that were sent/received before 2012-03-21 11:47, use message_timelt=2012-03-21 11:47
messagetimelte: lte stands for lesser than or equal. Eg: To get all messages that were sent/received before or exactly at 2012-03-21 11:47[:30], use messagetime__lte=2012-03-21 11:47[:30]
Optional
message_stateUse this argument to filter by the current status of a message. This argument can be set to one of following states : queued, sent, failed, delivered, undelivered, received or rejected.Optional
message_typeUse this argument to filter results by the type of message - sms or mms.Optional
error_codeUse this argument to filter results by a standard Plivo error codeOptional
limitUsed to display the number of results per page. The maximum number of results that can be fetched is 20. Defaults to 20.Optional
offsetDenotes the number of value items by which the results should be offset. Defaults to 0Optional

Request Params

KeyDatatypeRequiredDescription
subaccountstring1. Outbound messages sent using a specific sub-account's auth token.
  1. Inbound messages received on a phone number associated with a specific sub-account. | | message_direction | string | | Use this argument to filter the results by message direction. The valid inputs are inbound and outbound. | | message_time | string | | The timestamps are expected to in YYYY-MM-DD HH:MM[:ss[.uuuuuu]] format, and are considered to be in UTC timezone. | | message_state | string | | Use this argument to filter by the current status of a message. This argument can be set to one of following states : queued, sent, failed, delivered, undelivered, received or rejected | | message_type | string | | Use this argument to filter results by the type of message - sms or mms. | | error_code | number | | Use this argument to filter results by a standard Plivo error code. Read more about Plivo SMS error codes here. | | limit | number | | Used to display the number of results per page. The maximum number of results that can be fetched is 20. Defaults to 20. | | offset | number | | Denotes the number of value items by which the results should be offset. Defaults to 0. Read more about offset based pagination here. |