Skip to main content

Creating outbound notifications

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

  • A campaign is created in the Application.
  • One or more rules of a campaign change.

The notifications are sent as POST requests. See their structure in the following payload examples.

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 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
}
}
]
}