Retrieve previously sent messages. There might be a slight ( less than 1 minute ) delay before messages show up in this list.
Response format | JSON |
---|---|
Requires authentication? | Yes |
channel optional | Return messages on a specific channel. |
---|---|
to_phone_number optional | Return messages sent to a specific transport / subscriber. |
from_phone_number optional | Return messages sent from a specific transport / subscriber. |
start_time optional | Return messages from on or after specified start date ( format ). |
end_time optional | Return messages from before specified end date ( format ). |
status optional | Return messages for specified status (such as sent) |
curl -X GET \
-u '[SID]:[TOKEN]' \
-H 'Content-Type: application/json' \
'https://api.essential.to/v2/account/messages/search'
# Sample response
{
"total" : 7949,
"results" : [
{
"from_phone_number" : "+12067251311",
"created_at" : "2016-12-20T21:32:39.000Z",
"channel_name" : "default",
"sid" : "MepdscXeyOhi4suw_ZRDSw",
"body" : "Hello",
"carrier" : "AT&T Wireless",
"account_sid" : "QsbrYCSo2m0sShMLOlZqtw",
"channel_sid" : "w0qg3KKj1gqDkBMRyV48PA",
"to_phone_number" : "+12067251131",
"status" : "delivered",
"subscriber_sid" : "YBh0ADRnmOeXAZaZJgD7RQ",
"media_urls" : null,
"msecs_in_flight" : 2300
},
...
]
# messages for a channel
curl -X GET \
-u '[SID]:[TOKEN]' \
-H 'Content-Type: application/json' \
'https://api.essential.to/v2/account/messages/search' \
-G -d 'channel=p03Gjl8Uzn0RkZSpHXHnrw'
# messages since start_date and before end_date
curl -X GET \
-u '[SID]:[TOKEN]' \
-H 'Content-Type: application/json' \
'https://api.essential.to/v2/account/messages/search' \
-G -d 'start_time=2018-03-21T00:00:00.000Z' -d 'end_time=2018-04-01'
# messages for status received
curl -X GET \
-u '[SID]:[TOKEN]' \
-H 'Content-Type: application/json' \
'https://api.essential.to/v2/account/messages/search' \
-G -d 'status=received'
Python coming soon.
Node coming soon.