Create, update and delete groups, add or remove group members, and read a group's members and events (opens, clicks, unsubscribes and more).
All endpoints use the base URL https://webapi.mymarketing.co.il and an API key in the Authorization header. New to the API? Start with Get started with the ActiveTrail API.
Endpoints
| Method | Endpoint | What it does |
|---|---|---|
GET | /api/ | Get account's groups |
GET | /api/ | Get group information by id |
POST | /api/ | Create and return a new Group |
PUT | /api/ | Update a given group |
DELETE | /api/ | Delete a given group |
GET | /api/ | Get all group members |
POST | /api/ | Add contact to a specific group |
DELETE | /api/ | Remove member from a group |
GET | /api/ | Get all group events |
Endpoint details
Get account's groups
GET https://webapi.mymarketing.co.il/api/groups
| Parameter | In | Type | Description |
|---|---|---|---|
search_term | query | string | Group name to search for. |
page | query | integer | Get a specific page (number of pages is limited) (Range: inclusive between 1 and 2147483647) |
limit | query | integer | Limit the number of items you get in the results. (Removing the "limit" will, by default, display only 20 records) (Range: inclusive between 1 and 100) |
Full reference, request and response samples
Get group information by id
GET https://webapi.mymarketing.co.il/api/groups/{Id}
| Parameter | In | Type | Description |
|---|---|---|---|
Id | path | integer | Group id. Can be found using the endpoint "Get account's groups" or in the UI (go to Contacts->Groups->click on the group's name -> you'll find the id in the URL) Required. |
Full reference, request and response samples
Create and return a new Group
POST https://webapi.mymarketing.co.il/api/groups
| Parameter | In | Type | Description |
|---|---|---|---|
name | body | string | Name of the group |
active_counter | body | integer | Number of active contacts in the group |
counter | body | integer | Total contacts in the group |
created | body | date | Date of creation of the group |
last_generated | body | date | Dynamic group only- the last time it generated contacts according to the group conditions |
The request body is a JSON object (PostGroupContainer).
Full reference, request and response samples
Update a given group
PUT https://webapi.mymarketing.co.il/api/groups/{id}
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Group id. Can be found using the endpoint "Get account's groups" or in the UI (go to Contacts->Groups->click on the group's name -> you'll find the id in the URL) Required. |
name | body | string | Name of the group |
active_counter | body | integer | Number of active contacts in the group |
counter | body | integer | Total contacts in the group |
created | body | date | Date of creation of the group |
last_generated | body | date | Dynamic group only- the last time it generated contacts according to the group conditions |
The request body is a JSON object (UpdateGroupContainer).
Full reference, request and response samples
Delete a given group
DELETE https://webapi.mymarketing.co.il/api/groups/{id}
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Group id. Can be found using the endpoint "Get account's groups" or in the UI (go to Contacts->Groups->click on the group's name -> you'll find the id in the URL) Required. |
Full reference, request and response samples
Get all group members
GET https://webapi.mymarketing.co.il/api/groups/{id}/members
Get all group members. You can get the list filtered by customer status (active, unsubscribed, bounced. etc.,) by the state change date (from/to date, the default is three months back)
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Group id. Can be found using the endpoint "Get account's groups" or in the UI (go to Contacts->Groups->click on the group's name -> you'll find the id in the URL) Required. |
customer_states | query | CustomerStates | Filter by contact status. A contact matches if its email or SMS status is one of them. Values: ALL, ACTIVE, INACTIVE, CUSTOMER_REQUEST, BOUNCED, SPAM_COMPLIENT, QUARANTINED. |
search_term | query | string | Search by email/sms. please note: you cannot search for emails that contain the plus sign. |
from_date | query | date | Start of the date range. Format: mm-dd-yyyy. |
to_date | query | date | End of the date range. Format: mm-dd-yyyy. |
page | query | integer | Get a specific page (number of pages is limited) (Range: inclusive between 1 and 2147483647) |
limit | query | integer | Limit the number of items you get in the results. (Removing the "limit" will, by default, display only 20 records) (Range: inclusive between 1 and 100) |
Full reference, request and response samples
Add contact to a specific group
POST https://webapi.mymarketing.co.il/api/groups/{id}/members
Add contact to a specific group. You can set the contact's status. please note: you cannot import a contact in status subscribe if he is inactive on ActiveTrail
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Group id. Can be found using the endpoint "Get account's groups" or in the UI (go to Contacts->Groups->click on the group's name -> you'll find the id in the URL) Required. |
campaign_id | body | integer | The campaign id to send to the imported contact (optional) |
subscribe_ip | body | string | The Subscribe Ip |
status | body | ApiStatusTypes | The contact's email status. Values: None (0), Subscribed (1), Unsubscribed (2), Pending (3). |
sms_status | body | ApiStatusTypes | The contact's SMS status. Values: None (0), Subscribed (1), Unsubscribed (2), Pending (3). |
double_optin | body | DoubleOptin | See DoubleOptin |
email | body | string | Required if SMS is null. please note: mandatory in the endpoint "Create a new contact" and in "Send an email operational message to individual contacts" |
sms | body | string | Required if email is null. |
first_name | body | string | Contact field |
last_name | body | string | Contact field |
anniversary | body | date | Contact field |
birthday | body | date | Contact field |
city | body | string | Contact field |
fax | body | string | Contact field |
phone1 | body | string | Contact field |
phone2 | body | string | Contact field |
street | body | string | Contact field |
zip_code | body | string | Contact field |
ext1 … num5 | body | string / date / number | Custom contact fields (35 fields). Same meaning as the contact fields in ActiveTrail. |
is_deleted | body | boolean | If true - contact will be deleted. If false - contact will be restored if deleted (their status will be the last status they were on ActiveTrail). |
The request body is a JSON object (PostContactTriggerContainer).
Full reference, request and response samples
Remove member from a group
DELETE https://webapi.mymarketing.co.il/api/groups/{id}/members/{memberId}
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Group id. Can be found using the endpoint "Get account's groups" or in the UI (go to Contacts->Groups->click on the group's name -> you'll find the id in the URL) Required. |
memberId | path | integer | Contact id. Can be found using the endpoint "Get all group members...." Required. |
Full reference, request and response samples
Get all group events
GET https://webapi.mymarketing.co.il/api/groups/{id}/events
Get all group events. You can get the list filtered by event type (opens, clicks, unsubscribes, etc.), by the event date (from/to date, the default is three months back), by the subscriber creation date (from/to date, the default is three months back)
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Group id. Can be found using the endpoint "Get account's groups" or in the UI (go to Contacts->Groups->click on the group's name -> you'll find the id in the URL) Required. |
EventType | query | GroupEventTypes | Type of event to retrieve metrics for (opens, clicks, unsubscribes) required |
CreatedFromDate | query | date | Start date for subscriber creation |
CreatedToDate | query | date | End date for subscriber creation |
EventFromDate | query | date | Start date for events |
EventToDate | query | date | End date for events |
Full reference, request and response samples
This reference is based on the ActiveTrail API documentation, where you can also test each endpoint with your own API key.