List Sent Messages
This API lists sent messages, i.e. messages you have sent. When viewing the sent messages, you can view the list if available messages, or view an individual message. Viewing the individual message will also view the files attached to the message.
Viewing available Sent Messages
Info | Value |
---|---|
Request URL | /messages/sent |
Request VERB | GET |
Parameter | Type | Description |
---|---|---|
sent_after | Date | List messages sent after YYYY-MM-DD. |
sent_in_the_last | Integer | List messages sent in the last X number of hours. |
limit | Integer | Limit the display of a certain number of messages. On default all messages will be retrieved |
Response Parameters
Please see the Message Attributes for a complete list of the Message Attributes in the API response.
Example using curl
curl -s -X GET --user "$api_key:x" -H "Accept: application/json" -H "Content-Type: application/json" https://test.host/messages/sent {"sent": [ { "id":"1p4EHkeNzM5b2qO7kyNEIy", "sender":"user@example.com", "recipients":["recipient@customer.com"], "ccs":[], "created_at":"2011-07-09 06:51:07", "expires_at":"2011-07-23", "expires_after":2, "authorization":3, "size":7340032, "private_message":false, "authorization_description":"Only Specified Recipients can access", "url":"https://www.example.com/message/1p4EHkeNzM5b2qO7kyNEIy", "subject":"test subject", "message":"Test Message", "attachments":[ { "id":"JUE1PlqlT0CpI1VX4UbGnx", "filename":"intro_movie.mp4", "size":2097152, "content_type":"video/mp4", "checksum":"07dc261df7ff3f428e1f115dfde91ecccd83c9ebb896962918de5a56272141ad", "crc32":"8d89877e", "created_at":"2011-07-09 06:51:07", "url":"https://www.example.com/message/1p4EHkeNzM5b2qO7kyNEIy/JUE1PlqlT0CpI1VX4UbGnx/Q7KQrayc1qdNpuCxSfXx1p/intro_movie.mp4" } ] } ] }
Viewing a message
If you know the message ID (listed above), you can view an individual message.
Info | Value |
---|---|
Request URL | /message/message_id |
Request VERB | GET |
Parameter | Type | Description |
---|---|---|
id | String | The message ID |
sender | String | The sender of the message |
recipients | Array | All the specified recpients |
ccs | Array | All the cc'd recpients |
bccs | Array | All the bcc'd recpients |
created_at | DateTime | When the message was created |
expires_at | Date | When the message expires |
authorization | Integer |
|
authorization_description | String | The description of the authorization |
subject | String | The message subject |
message | String | The body of the message |
attachments | String | The attached files with the following parameters:
|
Example using Curl
curl -s -X GET --user "$api_key:x" -H "Accept: application/json" -H "Content-Type: application/json" https://test.host/message/1p4EHkeNzM5b2qO7kyNEIy {"message": { "id":"1p4EHkeNzM5b2qO7kyNEIy", "sender":"user@example.com", "recipients":["recipient@customer.com"], "ccs":[], "created_at":"2011-07-09 06:51:07", "expires_at":"2011-07-23", "expires_after":2, "authorization":3, "size":7340032, "authorization_description":"Only Specified Recipients can access", "url":"https://www.example.com/message/1p4EHkeNzM5b2qO7kyNEIy", "subject":"test subject", "message":"Test Message", "attachments":[ { "id":"JUE1PlqlT0CpI1VX4UbGnx", "filename":"intro_movie.mp4", "size":2097152, "content_type":"video/mp4", "checksum":"07dc261df7ff3f428e1f115dfde91ecccd83c9ebb896962918de5a56272141ad", "crc32":"8d89877e", "created_at":"2011-07-09 06:51:07", "url":"https://www.example.com/message/1p4EHkeNzM5b2qO7kyNEIy/JUE1PlqlT0CpI1VX4UbGnx/Q7KQrayc1qdNpuCxSfXx1p/intro_movie.mp4" } ] } }
In this example, there's one available attachment. Using the URL, you can download the file. Again, using curl:
curl -s -X GET --user "$api_key:x" -H "Accept: application/json" -H "Content-Type: application/json" https://test.host/message/1p4EHkeNzM5b2qO7kyNEIy/ZfYoatTMcYQLX0qUutOate/A3ohjLyybRyFMj9x65KbzE/secret_image.jpg
Please note that the URL is a one time URL and it will expire after the file has been downloaded. It's not possible to link to individual files without viewing the message.