Create, send, schedule, update and delete email campaigns, to groups or to individual contacts.
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 email campaigns |
GET | /api/ | Get campaign by id |
POST | /api/ | Create and return a new campaign for specific groups |
PUT | /api/ | Update a given campaign |
GET | /api/ | Get campaign details |
PUT | /api/ | Update campaign details |
GET | /api/ | Get campaign template |
PUT | /api/ | Update campaign template |
GET | /api/ | Get campaign design |
PUT | /api/ | Update campaign design |
GET | /api/ | Get campaign sending settings (groups and sending restrictions) |
PUT | /api/ | Update campaign sending settings (groups and sending restrictions) |
GET | /api/ | Get campaign schedule |
PUT | /api/ | Update campaign schedule |
DELETE | /api/ | Delete campaign |
GET | /api/ | Return a list of sent campaigns |
POST | /api/ | Create and return a new campaign for specific contacts |
Endpoint details
Get account's email campaigns
GET https://webapi.mymarketing.co.il/api/campaigns
Get account's email campaigns. You can get campaigns filtered by various parameters including date and limited to a number of campaigns (you will get campaigns that were last updated in the last 3 months by default)
| Parameter | In | Type | Description |
|---|---|---|---|
mailing_list_id | query | integer | Mailing list id. Use it only if you have mailing lists in your account. Can be found using the endpoint "Get account's mailing lists" or in the UI (go to Contacts->Mailing Lists->click on the mailing lists's name -> you'll find the id in the URL). |
content_category_id | query | integer | Category id. Can be found using the endpoint "Get the account's categories." |
search_term | query | string | campaign's name/partial name |
send_type | query | CampaignSendType | Campaign sent types |
from_date | query | date | Start of the date range, by the date the campaign was last updated. Format: yyyy-mm-dd. |
to_date | query | date | End of the date range, by the date the campaign was last updated. Format: yyyy-mm-dd. |
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 campaign by id
GET https://webapi.mymarketing.co.il/api/campaigns/{id}
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Campaign id. Can be found using the endpoint "Get account's email campaigns..." or in the UI (go to Emails->Emails Lists->click on the campaign's preview -> you'll find the id in the URL) Required. |
Full reference, request and response samples
Create and return a new campaign for specific groups
POST https://webapi.mymarketing.co.il/api/campaigns
Create and return a new campaign for specific groups. The campaign can be a regular, A/B split or e-commerce campaign.
| Parameter | In | Type | Description |
|---|---|---|---|
scheduling | body | ApiCampaignScheduling | When to send the campaign. Set is_sent to true and scheduled_date_utc to the send time (the current time sends it right away); set is_sent to false to only create the campaign. Required. |
carts | body | ApiEcommerceDataList | Your e-commerce data. This section has to be enabled for your account: contact ActiveTrail Support. |
pairs | body | Collection of Pair | can be used whether you chose to use the "content" or "template" parameters. The KEY can be any value (text type) you want. If the value is found in the template/content, it will be replaced with the corresponding VALUE. please note: if you send the email to a number of emails at the same time - the key and value cannot be personalized to each customer |
segment | body | ApiCampaignRestrictionsSegment | Campaign restrictions. If you use A/B testing, the restriction would work both on version A and version B (but not on the winning campaign) |
send_test | body | string | Email addresses you'd like to send a test email, should be separated by comma(,). |
details | body | ApiCampaignDetails | Required. |
design | body | ApiCampaignDesign | Required. |
template | body | ApiCampaignTemplate | |
a_b_settings | body | ApiABSettings |
The request body is a JSON object (ApiCampaignPost).
Full reference, request and response samples
Update a given campaign
PUT https://webapi.mymarketing.co.il/api/campaigns/{id}
Update a given campaign. Please note: only campaigns that are in a draft mode can be updated.
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Campaign id Required. |
send_test | body | string | Email addresses you'd like to send a test email, should be separated by comma(,). |
details | body | ApiCampaignDetails | Required. |
design | body | ApiCampaignDesign | Required. |
template | body | ApiCampaignTemplate | |
a_b_settings | body | ApiABSettings | |
carts | body | ApiEcommerceDataList | |
pairs | body | Collection of Pair |
The request body is a JSON object (ApiCampaignPut).
Full reference, request and response samples
Get campaign details
GET https://webapi.mymarketing.co.il/api/campaigns/{id}/details
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Campaign id. Can be found using the endpoint "Get account's email campaigns..." or in the UI(go to Emails->Emails Lists->click on the campaign's preview -> you'll find the id in the URL) Required. |
Full reference, request and response samples
Update campaign details
PUT https://webapi.mymarketing.co.il/api/campaigns/{id}/details
Update campaign details. Please note: only campaigns that are in draft mode can be updated
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Campaign id. Can be found using the endpoint "Get account's email campaigns..." or in the UI(go to Emails->Emails Lists->click on the campaign's preview -> you'll find the id in the URL) Required. |
name | body | string | The campaign's name. Internal use only. Required. |
subject | body | string | Campaign Subject Required. |
user_profile_id | body | integer | User profile ID. Required only in a Post endpoint. The email address of which the message will be sent from. Can be found using the endpoint "Get the account emails sending profiles" or in the UI (go to Emails -> Sending Profiles -> inspect/F12) |
google_analytics_name | body | string | Integrate your campaigns with google analytics. The campaign must be in English with no special characters or spaces. please note: if already have utm on your links - the integration will not work and the link might not be reachable |
content_category_id | body | integer | Catalog the campaigns to categories. Categories IDs can be found using the endpoint "Get the account's categories". If you remove the parameter, the catagory would automatically be the default category |
preheader | body | string | Short summary text that follows the subject line when viewing an email from the inbox. If you use A/B testing - it will be identical to both versions |
predictive_delivery | body | boolean | Specify if predictive delivery is enabled. If you don't have predictive delivery feature in your account - remove this parameter |
The request body is a JSON object (ApiCampaignDetails).
Full reference, request and response samples
Get campaign template
GET https://webapi.mymarketing.co.il/api/campaigns/{id}/template
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Campaign id. Can be found using the endpoint "Get account's email campaigns..." or in the UI(go to Emails->Emails Lists->click on the campaign's preview -> you'll find the id in the URL) Required. |
Full reference, request and response samples
Update campaign template
PUT https://webapi.mymarketing.co.il/api/campaigns/{id}/template
Update campaign template. Please note: only campaigns that are in draft mode can be updated
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Campaign id. Can be found using the endpoint "Get account's email campaigns..." or in the UI(go to Emails->Emails Lists->click on the campaign's preview -> you'll find the id in the URL) Required. |
id | body | integer | Template id. Can be found using the endpoint "Get account's "my templates"" or in the UI (go to "Emails" -> "My Templates" -> click on your desired template -> you'll find the ID at the end of the URL). Only required if you don't use the "content" parameter. |
The request body is a JSON object (ApiCampaignTemplate).
Full reference, request and response samples
Get campaign design
GET https://webapi.mymarketing.co.il/api/campaigns/{id}/design
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Campaign id. Can be found using the endpoint "Get account's email campaigns..." or in the UI(go to Emails->Emails Lists->click on the campaign's preview -> you'll find the id in the URL) Required. |
Full reference, request and response samples
Update campaign design
PUT https://webapi.mymarketing.co.il/api/campaigns/{id}/design
Update campaign design. Please note: only campaigns that are in draft mode can be updated
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Campaign id. Can be found using the endpoint "Get account's email campaigns..." or in the UI(go to Emails->Emails Lists->click on the campaign's preview -> you'll find the id in the URL) Required. |
content | body | string | Campaign content. Can be a simple text or HTML. Required only if you create a new A/B testing (email campaign - version A). If you don't - only required if you don't use the "template" parameter. |
language_type | body | SystemLanguageType | Set your campaign language type - using "UTF-8" is recommended |
header_footer_language_type | body | SystemLanguageType | Set your campaign language type - using "UTF-8" is recommended |
is_add_print_email | body | boolean | Add a 'print email' button |
is_auto_css_inliner | body | boolean | An option to set the CSS inline in the HTML content |
The request body is a JSON object (ApiCampaignDesign).
Full reference, request and response samples
Get campaign sending settings (groups and sending restrictions)
GET https://webapi.mymarketing.co.il/api/campaigns/{id}/segment
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Campaign id Required. |
Full reference, request and response samples
Update campaign sending settings (groups and sending restrictions)
PUT https://webapi.mymarketing.co.il/api/campaigns/{id}/segment
Update campaign sending settings (groups and sending restrictions). Please note: only campaigns that are in draft mode can be updated
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Campaign id. Can be found using the endpoint "Get account's email campaigns..." or in the UI(go to Emails->Emails Lists->click on the campaign's preview -> you'll find the id in the URL) Required. |
limit_amount | body | integer | Limit the number of emails |
limit_per_hour | body | integer | Limit the number of emails to send per hour |
last_days_not_received | body | integer | Send only to users who have not received an email in the specified number of days |
groups_excluded_ids | body | Collection of integer | Do not send the email to users that are in those groups. IDs 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) |
not_opened_campaign_ids | body | Collection of integer | Restrict the sending of the campaign to users who have not opened the following emails. Can be found using the endpoint "Get account's email campaigns..." or in the UI (go to Emails->Emails Lists->click on the campaign's preview -> you'll find the id in the URL) |
not_received_campaign_ids | body | Collection of integer | Restrict to users that did not receive the following emails. Can be found using the endpoint "Get account's email campaigns..." or in the UI (go to Emails->Emails Lists->click on the campaign's preview -> you'll find the id in the URL) |
group_ids | body | Collection of integer | List of group IDs that will receive the campaign. 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. |
mailing_list_id | body | integer | Mailing list Id. Required if you have mailing lists on your account - if not, remove this parameter. Can be found using the endpoint "Get account's mailing lists" or in the UI (go to Contacts->Mailing Lists->click on the mailing lists's name -> you'll find the id in the URL) |
The request body is a JSON object (ApiCampaignRestrictionsSegment).
Full reference, request and response samples
Get campaign schedule
GET https://webapi.mymarketing.co.il/api/campaigns/{id}/scheduling
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Campaign id. Can be found using the endpoint "Get account's email campaigns..." or in the UI(go to Emails->Emails Lists->click on the campaign's preview -> you'll find the id in the URL) Required. |
Full reference, request and response samples
Update campaign schedule
PUT https://webapi.mymarketing.co.il/api/campaigns/{id}/scheduling
Update campaign schedule. Please note: only campaigns that are in draft mode can be updated
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Campaign id. Can be found using the endpoint "Get account's email campaigns..." or in the UI(go to Emails->Emails Lists->click on the campaign's preview -> you'll find the id in the URL) Required. |
is_sent | body | boolean | Whether or not to send the campaign. Required. |
scheduled_date_utc | body | date | The date the campaign will be/was sent. If you use the post endpoint - date cannot be in past time. Required. |
The request body is a JSON object (ApiCampaignScheduling).
Full reference, request and response samples
Delete campaign
DELETE https://webapi.mymarketing.co.il/api/campaigns/{id}
| Parameter | In | Type | Description |
|---|---|---|---|
id | path | integer | Campaign id. Can be found using the endpoint "Get account's email campaigns..." or in the UI(go to Emails->Emails Lists->click on the campaign's preview -> you'll find the id in the URL) Required. |
Full reference, request and response samples
Return a list of sent campaigns
GET https://webapi.mymarketing.co.il/api/campaigns/SentCampaigns
No parameters.
Full reference, request and response samples
Create and return a new campaign for specific contacts
POST https://webapi.mymarketing.co.il/api/campaigns/Contacts
Create and return a new campaign for specific contacts. The campaign can be a regular, A/B split or e-commerce campaign.
| Parameter | In | Type | Description |
|---|---|---|---|
campaign | body | ApiCampaignUpdateContainer | |
campaign_contacts | body | ApiCampaignContact |
The request body is a JSON object (ApiCampaignContactPost).
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.