/merchants/{merchantCode}/campaigns (POST)
POST
/merchants/{merchantCode}/campaigns
Creates multiple campaigns
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”merchantCode
required
string
Request Body
Section titled “Request Body”Media typeapplication/json
object
campaigns
Array<object>
CAUTION: it is either “templateCode” or “messages” depending on if you want to base on a template or not
object
code
required
string
Example
CAMPAIGN1parentCampaignCode
string | null
Example
CAMPAIGN1_PARENTname
required
string
Example
Our first campaigntriggerType
required
string
settings
object
eventType
Only needed if type is event. With the option “custom” you can listen to custom events from external systems. If custom is set the property “customEventType” must be set
string
customEventType
Required if eventType is “custom”. This property associate an campaign with the custom event triggered via the notification event receiver
string | null
startDate
string | null
Example
2016-07-27T07:45:00ZendDate
string | null
Example
2016-07-27T07:45:00Ztimezone
string | null
triggerConditions
object | null
Example
{ "type": { "$in": [ "status1", "status2" ] }}sendDate
string | null
Example
2016-07-27T07:45:00ZscheduleType
string
Example
2016-07-27T07:45:00Ztimezone
string | null
description
string
Example
description of the entitymessages
object | null
delivery
object
methods
Array<object>
object
channel
required
string
settings
null | object
templateCode
null | string
Example
TEMPLATE1segmentCodes
Array<string | null> | null
segmentRules
null | object
Example
{}actions
object
primary
required
object
type
required
string
parameters
object
Example
{ "primary": { "type": "openWebPage", "parameter": { "url": "https://google.com" } }}tracking
object
addUTMToLinks
boolean
utmSource
string | null
utmMedium
string | null
utmCampaign
string | null
utmContent
string | null
status
string
Example
[ { "code": "blackFridayCampaignPush", "parentCampaignCode": "blackFridayCampaignParentPush", "name": "Campaign for Black Friday Push", "description": "Open the category blackFriday with all our special offers", "triggerType": "schedule", "settings": { "sendDate": "2020-11-04T12:40:15.000Z", "timezone": "America/Chicago", "scheduleType": "scheduled" }, "delivery": { "methods": [ { "channel": "push", "settings": null } ] }, "templateCode": "blackFridayCampaignTemplate", "segmentCodes": [ "VIPCustomer" ], "segmentRules": null, "actions": { "primary": { "type": "engage:showCategory", "parameters": { "categoryCode": "blackFriday" } } }, "tracking": { "addUTMToLinks": false, "utmSource": null, "utmMedium": null, "utmCampaign": null, "utmContent": null } }, { "code": "openProductPage", "parentCampaignCode": "openProductPageParent", "name": "Campaign for to open a product", "description": "Campaign for to open a product", "triggerType": "schedule", "settings": { "sendDate": "2020-11-04T12:40:15.000Z", "timezone": "America/Chicago", "scheduleType": "scheduled" }, "delivery": { "methods": [ { "channel": "push", "settings": null } ] }, "templateCode": "blackFridayCampaignTemplate", "segmentCodes": null, "segmentRules": null, "actions": { "primary": { "type": "engage:showProduct", "parameters": { "productCode": "24-MB1" } } }, "tracking": { "addUTMToLinks": false, "utmSource": null, "utmMedium": null, "utmCampaign": null, "utmContent": null } }, { "code": "readyForPickupSMS", "name": "Ready for Pickup - SMS", "description": "Customer received an SMS if the order is ready for pickup", "triggerType": "event", "settings": { "eventType": "fulfillmentOrderStatusUpdated", "triggerConditions": { "$and": [ { "event.newStatus": { "$eq": "ready" } } ] } }, "delivery": { "methods": [ { "channel": "sms", "settings": null } ] }, "messages": { "en-us": [ { "title": "Good News! Your order is ready for pickup", "body": "Your order number is #{{event.fulfillmentOrder.orderNumber}} and will be held until {{date event.fulfillmentOrder.heldUntil format='MM/DD/YYYY HH:mm' }}.\n Thanks for shopping with your favorite store", "image": "https://myAwesomeShop.com/images/93bbe270-94d1-4234-92e7-762a82263e51.png", "imageType": "custom" } ] }, "tracking": { "addUTMToLinks": false, "utmSource": null, "utmMedium": null, "utmCampaign": null, "utmContent": null } }, { "code": "customEventGoldStatusReached", "name": "Custom Event - Gold Status Reached", "description": "Triggered when a customer receives the gold status", "triggerType": "event", "settings": { "eventType": "custom", "customEventType": "goldStatusReached" }, "delivery": { "methods": [ { "channel": "sms", "settings": null } ] }, "messages": { "en-us": [ { "title": "Good News! You're a gold member now", "body": "Hi {{customer.firstName}}, with your loyalty card {{customParameters.cardNumber}} you reached the gold member status", "image": "https://myAwesomeShop.com/images/gold.png", "imageType": "custom" } ] }, "tracking": { "addUTMToLinks": false, "utmSource": null, "utmMedium": null, "utmCampaign": null, "utmContent": null } }]Responses
Section titled “Responses”Successfully created
Media typeapplication/json

