ActiveTrail Guides

Get Started with the ActiveTrail API

With ActiveTrail RESTful API, you can sync email, contact activity and campaign statistics with your database, manage groups, create and edit Automation workflows, and test different calls and endpoints before pushing to production.
After reading through this guide, be sure to check out the API Reference to see all of the available api requests. there you can test calls in real-time with your own data.

In this guide:

Before You Start

The ActiveTrail API is designed for developers, engineers, or anyone else who’s comfortable creating custom-coded solutions or integrating with RESTful APIs.
The REST architectural style is an integral part of RESTful. If you’d like to learn more about REST before using the API, check out the introduction to representational state transfer (REST) .

Resources

Resources are typically nouns like ‘subscribers’ or ‘campaigns’ that you take actions on using supported HTTP verbs.
Each resource is typically separated into a resource/{id} format, with subresources following the same pattern. For example, if you’re looking for information about a group, make a GET request to https://webapi.mymarketing.co.il/api/groups. To access an individual group, such as group with id 1234, make a GET request to
https://webapi.mymarketing.co.il/api/groups/1234.

Authentication

There is a basic authentication method for the api just add a header to the request called authorization and as the value put the token that you got from the web interface (go to settings ->
API apps) and create a new Token.
You can restrict it to specific IPs and give it an expiry date. You can create as many tokens as you need.

HTTP Methods

GET
Make a GET request to retrieve data. GET requests will never update or change your data because they’re safe and idempotent .

POST
Use a POST request to create new resources. For example, make a POST request to a collection endpoint (like /groups) where the body of your request contains the JSON structure of the new group.

PUT
Use a PUT request to update a resource. This is most useful for syncing subscriber data.

DELETE
Make a DELETE request to remove a resource by giving the entity’s id.

JSON

The ActiveTrail API only supports JSON & XML body.
The API Reference includes complete examples for the data format.

Parameters

There are 4 main categories of parameters for each endpoint in the ActiveTrail API: path, query string, request body, and response body.
The API Reference includes a list of all available parameters for each possible request,
but these sections offer an overview of the 4 main categories and their subcategories.

Path parameters

In an API URL, we include resource names and unique identifiers to help you figure out how to structure your requests. Resource names are immutable, but resource identifiers are required, so you need to replace them with real values from your ActiveTrail account. Let’s look at an example:

https://webapi.mymarketing.co.il/groups/{group_id}/members/{email}

In that URL, there is 1 primary resource, group, and 1 subresource: members. There are also 2 different path parameters that you need to replace with real values from your ActiveTrail account:group_id and email.

Query string parameters

We use query string parameters for filtering, pagination, and partial responses in the ActiveTrail API. The format for query string parameters is the full resource URL followed by a question mark, and the optional parameters:

Pagination

Paginate your API requests to limit response results and make them easier to work with.
We use page and limit in the URL query string to paginate because it provides greater control over how you view your data.
page defaults to 0, so if you use page=1, you’ll miss the first element in the dataset.
limit defaults to 100 and you cannot have a limit greater than 100. For example, this URL includes query string parameters for pagination:

https://webapi.mymarketing.co.il/api/groups? Page=0&Limit=100

This is the same as sending without any parameters :

https://webapi.mymarketing.co.il/api/groups

to get the next page make another request:

https://webapi.mymarketing.co.il/api/groups? Page=1&Limit=100

Request body parameters

For PUT, and POST requests, you may need to include a request body in JSON format. The API Reference shows you all the available request parameters for each endpoint, including required fields.