Skip to main content
Messages API read
Marcel Ursprung avatar
Written by Marcel Ursprung
Updated over a month ago

Visit api.envoke.com to test APIs and get examples in 20+ languages

Return a list of messages

Endpoint: /messages
​HTTP method: GET
​URL: https://e1.envoke.com/v2/messages

Get a list of message objects. This list can be filtered by a number of conditions see API Filtering. The result set can be returned sorted, limited to a total number of results and paged by skipping a number of records. The result limit is 100 records in a single request, when no limit is set it defaults to 10 records.

NOTE: All examples below are formatted for readability, actual GET requests require URI encoding. Each example below also includes a cURL request. Make sure to change the API_ID and API_KEY with your values.

Message HTML

Due to the size of the typical message html property it's not returned in a listing of messages. To include it in your result set use the 'include_html' query parameter when returning a single message.

Get a single message with the id "1234"

Without HTML:

https://e1.envoke.com/v2/messages/1234

curl -X GET -u API_ID:API_KEY "https://e1.envoke.com/v2/messages/1234"

With HTML:

https://e1.envoke.com/v2/messages/1234?include_html=1

curl -X GET -u API_ID:API_KEY "https://e1.envoke.com/v2/messages/1234?include_html=1"

Return all messages

NOTE: With no limit specified the API will only return the first 10 records.

https://e1.envoke.com/v2/messages

curl -X GET -u API_ID:API_KEY "https://e1.envoke.com/v2/messages"

Skipping messages and limiting the result set

Get the second set of 10 messages from 11-20
https://e1.envoke.com/v2/messages?skip=10&limit=10

curl -X GET -u API_ID:API_KEY "https://e1.envoke.com/v2/messages?skip=10&limit=10"

​

Find 5 messages sorted by name ascending

https://e1.envoke.com/v2/messages?sort[name]=ASC&limit=5

curl -X GET -u API_ID:API_KEY "https://e1.envoke.com/v2/messages?sort%5Bname%5D=ASC&limit=5"

Find a message by subject

https://e1.envoke.com/v2/messages?filter[subject]=test%20message

curl -X GET -u API_ID:API_KEY "https://e1.envoke.com/v2/messages?filter%5Bsubject%5D=test%20message"

Return a key value pair (id & name) for all messages

https://e1.envoke.com/v2/messages?result_type=kvp

curl -X GET -u API_ID:API_KEY "https://e1.envoke.com/v2/messages?result_type=kvp"

RESPONSE:
{
"123": "test message",
"124": "Winter update",
"125": "Newsletter 25",
...
}
Did this answer your question?