Skip to main content

Making requests

You can paste the command below into your terminal to run your first API request. Make sure to replace YOUR_API_KEY with your secret API key.

curl -X GET https://api.realmailers.com/v1/campaigns -H 'Authorization: YOUR_API_KEY'

This request queries all of your campaigns. You should get a response back that resembles the following:

{
"current_page": 1,
"total_count": 0,
"total_pages": 1,
"items": []
}

Request Encoding​

Requests can be made with the standard encoding (application/x-www-form-urlencoded) or JSON. Requests with files should be sent with multipart/form-data instead of JSON.

Paramter Syntax​

The request parameters (query, form data) are using syntax from Ruby on Rails. The same values for Ruby on Rails and JSON can be seen in the examples below:

sender[address_state]=NY
sender[address_city]=New York
{
"sender": {
"address_city": "New York",
"address_state": "NY"
}
}
meta_data[][key]=key1
meta_data[][key]=key2
meta_data[][value]=value1
meta_data[][value]=value2
{
"meta_data": [
{ "key": "key1", "value": "value1" },
{ "key": "key2", "value": "value2" }
]
}

To learn more checkout the guide here: https://guides.rubyonrails.org/action_controller_overview.html#parameters