Manage your templates ("My templates") and template categories, read and update a template's content, and create a campaign from a template. Deleting a template category also deletes all the templates in it.

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

MethodEndpointWhat it does
GET/api/templatesGet account's "my templates"
GET/api/templates/{id}Get a specific template' information
POST/api/templatesCreate and return a new template
PUT/api/templates/{id}Update a specific template
DELETE/api/templates/{id}Delete a specific template
GET/api/templates/{id}/contentGet a template's content
PUT/api/templates/{Id}/contentUpdate template's content
POST/api/templates/{Id}/campaignCreate campaign using a specific template
GET/api/templates/TemplateCategoryGet "my templates" categories
POST/api/templates/TemplateCategoryCreate and return a new template category
PUT/api/templates/TemplateCategory/{id}Update the given template category
DELETE/api/templates/TemplateCategory/{id}Delete the given template category

Endpoint details

Get account's "my templates"

GET https://webapi.mymarketing.co.il/api/templates

No parameters.

Full reference, request and response samples

Get a specific template' information

GET https://webapi.mymarketing.co.il/api/templates/{id}
ParameterInTypeDescription
idpathintegerTemplate 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). Required.

Full reference, request and response samples

Create and return a new template

POST https://webapi.mymarketing.co.il/api/templates
ParameterInTypeDescription
namebodystringThe template's name Required.
subjectbodystringThe subject of the email that will be sent - for operational messages only
preheaderbodystringThe preheader of the email that will be sent - for operational messages only
classificationbodystringTemplate classification. Used to classify operational messages reports
AddPrintButtonbodybooleanAdd Print Button
template_category_idbodyintegerTo which category the template will be added to. Can be found using the endpoint "Get "my templates" categories".
template_category_namebodystringTemplate category Name. Will be the category name that is related to the category ID. Can be removed in a post/put endpoint
campaign_encodingbodySystemLanguageTypeCampaign encoding of the given template. UTF-8 is recommended in a post/put endpoint
contentbodystringThe template's content. A clean text (without any design to it) or HTML content. if you send HTML content please note you should use back-slash before each quotation mark.

The request body is a JSON object (ApiCampaignTemplateUpdatePost).

Full reference, request and response samples

Update a specific template

PUT https://webapi.mymarketing.co.il/api/templates/{id}
ParameterInTypeDescription
idpathintegerTemplate 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). Required.
namebodystringThe template's name Required.
subjectbodystringThe subject of the email that will be sent - for operational messages only
preheaderbodystringThe preheader of the email that will be sent - for operational messages only
classificationbodystringTemplate classification. Used to classify operational messages reports
AddPrintButtonbodybooleanAdd Print Button
template_category_idbodyintegerTo which category the template will be added to. Can be found using the endpoint "Get "my templates" categories".
template_category_namebodystringTemplate category Name. Will be the category name that is related to the category ID. Can be removed in a post/put endpoint
campaign_encodingbodySystemLanguageTypeCampaign encoding of the given template. UTF-8 is recommended in a post/put endpoint
contentbodystringThe template's content. A clean text (without any design to it) or HTML content. if you send HTML content please note you should use back-slash before each quotation mark.

The request body is a JSON object (ApiCampaignTemplateUpdatePost).

Full reference, request and response samples

Delete a specific template

DELETE https://webapi.mymarketing.co.il/api/templates/{id}
ParameterInTypeDescription
idpathintegerTemplate 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). Required.

Full reference, request and response samples

Get a template's content

GET https://webapi.mymarketing.co.il/api/templates/{id}/content
ParameterInTypeDescription
idpathintegerTemplate 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). Required.

Full reference, request and response samples

Update template's content

PUT https://webapi.mymarketing.co.il/api/templates/{Id}/content
ParameterInTypeDescription
IdpathintegerTemplate 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). Required.
namebodystringThe template's name Required.
subjectbodystringThe subject of the email that will be sent - for operational messages only
preheaderbodystringThe preheader of the email that will be sent - for operational messages only
classificationbodystringTemplate classification. Used to classify operational messages reports
AddPrintButtonbodybooleanAdd Print Button
template_category_idbodyintegerTo which category the template will be added to. Can be found using the endpoint "Get "my templates" categories".
template_category_namebodystringTemplate category Name. Will be the category name that is related to the category ID. Can be removed in a post/put endpoint
campaign_encodingbodySystemLanguageTypeCampaign encoding of the given template. UTF-8 is recommended in a post/put endpoint
contentbodystringThe template's content. A clean text (without any design to it) or HTML content. if you send HTML content please note you should use back-slash before each quotation mark.

The request body is a JSON object (ContentTemplateUpdateInfo).

Full reference, request and response samples

Create campaign using a specific template

POST https://webapi.mymarketing.co.il/api/templates/{Id}/campaign
ParameterInTypeDescription
IdpathintegerTemplate 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). Required.
campaign_detailsbodyApiCampaignDetailsThe details of the campaign that you create: name, campaign subject, sending profile id, google analytics, campaign category id, sub account id and preheader.
pairsbodyCollection of PairKey and value pairs: wherever a KEY (any text) appears in the template, it's replaced with its VALUE. If you send the email to several addresses at once, the values are the same for all of them.

The request body is a JSON object (ApiCampaignPostInfo).

Full reference, request and response samples

Get "my templates" categories

GET https://webapi.mymarketing.co.il/api/templates/TemplateCategory

No parameters.

Full reference, request and response samples

Create and return a new template category

POST https://webapi.mymarketing.co.il/api/templates/TemplateCategory
ParameterInTypeDescription
namebodystringThe category's name.
name_keybodystringCan be deleted in a post/put endpoints

The request body is a JSON object (ApiTemplateCategoryPost).

Full reference, request and response samples

Update the given template category

PUT https://webapi.mymarketing.co.il/api/templates/TemplateCategory/{id}
ParameterInTypeDescription
idpathintegerCategory Id. Can be found using the endpoint "Get "my templates" categories". Required.
namebodystringThe category's name.
name_keybodystringCan be deleted in a post/put endpoints

The request body is a JSON object (ApiTemplateCategoryPost).

Full reference, request and response samples

Delete the given template category

DELETE https://webapi.mymarketing.co.il/api/templates/TemplateCategory/{id}

Delete the given template category. please note: if you delete a category - all the templates in this category will be deleted as well

ParameterInTypeDescription
idpathintegerCategory Id. Can be found using the endpoint "Get "my templates" categories" Required.

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.