Skip to main content

Outbound notifications

You can set up notifications in an Application to be informed within 5 minutes when one or more of the following events occur:

  • A new campaign is created.
  • The state of a campaign changed.
  • One or more rules changed.
  • A campaign or a budget was edited.
  • The priority for one or more campaigns changed.

Notifications are set as webhooks, and the notification schemas depend on the event type.

note

Two requests are sent for the same notification: one for campaign priority changes, which occur at the Application level, and another for all other events.

It is not possible to choose which notifications you want to receive. You will receive notifications for all event types and for all campaigns within an Application.

Creating an outbound notification

The maximum number of notifications that you can create is established in your contract.

  1. Select the Application where you want to set up campaign notifications.

  2. Click Settings > Notifications in the left-side menu.

  3. Click Set up notification, if you have not created any yet.

    note

    If you have already created one or more notifications in this same Application, click Add a new URL to create new ones. It allows you to be notified through different routes at the same time.

  4. In the New notification pop-up, enter the URL where you want to receive notifications in the URL box.

  5. In Header-Name, enter a header.

  6. (Optional) Click Add header for each additional header value required by the receiving party, and enter the corresponding headers.

  7. Click Save.

  8. The notification is ready, see the payloads that you will receive and start parsing them as needed.

Editing an outbound notification

You can edit the URL and the header of an outbound notification at any time.

  1. Select the Application where you want to edit an outbound notification.
  2. Click Settings > Notifications in the left-side menu.
  3. Click the edit symbol to the right of the required notification.
  4. Edit the required details.
  5. Click Save.

A pop-up notification appears, confirming that your notification settings have been saved.

Deleting an outbound notification

You can delete an outbound notification to stop being notified about campaign updates through a given route.

  1. Select the Application where you want to delete an outbound notification.
  2. Click Settings > Notifications in the left-side menu.
  3. Click the delete symbol to the right of the required notification.
  4. Click Delete in the pop-up that appears.

A pop-up notification appears, confirming that your notification settings have been saved.

Payload examples

Outbound notifications are sent as POST requests. See the structure for each event:

A campaign was created
{
"TotalResultSize": 1,
"Data": [
{
"event": "campaign_created",
"campaign": {
"id": 2,
"created": "2021-12-23T09:37:47.22Z",
"applicationId": 2,
"userId": 1,
"name": "Christmas Campaign",
"description": "Special discount campaign for Christmas 2021",
"attributes": {
"Country": "Germany"
},
"state": "enabled",
"tags": ["christmas"],
"features": ["coupons"],
"limits": [
{
"action": "redeemCoupon",
"limit": 1,
"period": "yearly",
"entities": "Profile"
}
],
"campaignGroups": [1, 4],
"updated": "2021-12-23T09:37:47.22Z",
"updatedBy": "Admin"
}
}
]
}
The state of a campaign changed
{
"TotalResultSize": 1,
"Data": [
{
"event": "campaign_state_changed",
"campaign": {
"id": 2,
"created": "2021-12-20T09:37:47.643504Z",
"applicationId": 2,
"userId": 1,
"name": "Christmas Campaign",
"description": "Special discount campaign for Christmas 2021",
"startTime": "2021-12-23T00:00:00Z",
"endTime": "2021-12-27T00:00:00Z",
"attributes": {
"Country": "Germany"
},
"state": "disabled",
"activeRulesetId": 1,
"tags": ["christmas"],
"features": ["coupons"],
"limits": [
{
"action": "redeemCoupon",
"limit": 1,
"period": "yearly",
"entities": "Profile"
}
],
"campaignGroups": [1, 4],
"updated": "2021-12-20T09:46:47.113205Z",
"updatedBy": "Admin"
},
"oldState": "draft",
"newState": "disabled"
}
]
}
The rules of a campaign changed
{
"TotalResultSize": 1,
"Data": [
{
"event": "campaign_rusleset_changed",
"campaign": {
"id": 2,
"created": "2021-12-20T11:09:40.140801Z",
"applicationId": 2,
"userId": 1,
"name": "Christmas Campaign",
"description": "Special discount campaign for Christmas 2021",
"startTime": "2021-12-23T00:00:00Z",
"endTime": "2021-12-27T00:00:00Z",
"attributes": {
"Country": "Germany"
},
"state": "enabled",
"activeRulesetId": 1,
"tags": [
"christmas"
],
"features": [
"coupons"
],
"limits": [
{
"action": "createCoupon",
"limit": 10000,
"period": "yearly",
"entities": "Campaign"
}
],
"campaignGroups": [
1,
4
],
"updated": "2021-12-21T11:12:39.342196Z",
"updatedBy": "Admin"
},
"oldRuleset": {
"id": 1,
"created": "2021-12-20T16:35:03.337267Z",
"userId": 1,
"rules": [
{
"title": "Demo Rule 1",
"conditions": [
"always"
],
"effects": [
[
"catch",
[
"noop"
],
[
"showNotification",
"Offer",
"Additional Discount",
[
"concat",
"Demo",
"notification"
]
]
]
]
}
],
"bindings": [],
"rbVersion": "v2",
"campaignId": 2
},
"ruleset": {
"id": 2,
"created": "2021-12-21T11:12:39.337267Z",
"userId": 1,
"rules": [
{
"title": "Demo Rule 2",
"conditions": [
"always"
],
"effects": [
[
"catch",
[
"noop"
],
[
"showNotification",
"Info",
"Retargeting",
[
"concat",
"Demo",
"notification"
]
]
]
]
}
],
"bindings": [],
"rbVersion": "v2",
"campaignId": 2
}
}
]
}
A campaign was edited
{
"TotalResultSize": 1,
"Data": [
{
"event": "campaign_edited",
"campaign": {
"id": 2,
"created": "2021-12-20T09:37:47.643504Z",
"applicationId": 2,
"userId": 1,
"name": "Christmas Campaign",
"description": "Special discount campaign for Christmas 2021",
"startTime": "2021-12-23T00:00:00Z",
"endTime": "2021-12-27T00:00:00Z",
"attributes": {
"Country": "Germany"
},
"state": "enabled",
"activeRulesetId": 1,
"tags": [
"christmas"
],
"features": [
"coupons",
"referrals"
],
"limits": [
{
"action": "redeemCoupon",
"limit": 1,
"period": "yearly",
"entities": "Profile"
}
],
"campaignGroups": [
1,
4
],
"updated": "2021-12-20T09:49:03.113205Z",
"updatedBy": "Admin"
},
"oldCampaign": {
"id": 2,
"created": "2021-12-20T09:37:47.643504Z",
"applicationId": 2,
"userId": 1,
"name": "Christmas Campaign",
"description": "Special discount campaign for Christmas 2021",
"startTime": "2021-12-23T00:00:00Z",
"endTime": "2021-12-27T00:00:00Z",
"attributes": {
"Country": "Germany"
},
"state": "enabled",
"activeRulesetId": 1,
"tags": [
"christmas",
],
"features": [
"coupons",
"referrals"
],
"limits": [
{
"action": "redeemCoupon",
"limit": 1,
"period": "yearly",
"entities": "Profile"
}
],
"campaignGroups": [
1,
4
],
"updated": "2021-12-20T09:44:39.584062Z",
"updatedBy": "Admin"
}
}
]
}
The priority of a campaign changed
{
"TotalResultSize": 1,
"Data": [
{
"event": "campaign_priorities_changed",
"application": {
"id": 370,
"created": "2022-02-17T16:48:24.531765+01:00",
"modified": "2022-02-17T16:50:24.531765+01:00",
"accountId": 1,
"name": "application",
"description": "",
"timezone": "Europe/Berlin",
"currency": "EUR",
"caseSensitivity": "sensitive",
"attributes": {},
"limits": [],
"enableCascadingDiscounts": false,
"enableFlattenedCartItems": false,
"attributesSettings": {},
"sandbox": true,
"enablePartialDiscounts": false,
"loyaltyPrograms": []
},
"oldPriorities": {
"exclusive": [],
"stackable": [1, 2, 3, 4],
"universal": []
},
"priorities": {
"exclusive": [],
"stackable": [1, 2, 3],
"universal": [4]
}
}
]
}