WLL Marketing Core API
API Endpoint
api.marketing.wlloyalty.net/v1Introduction
White Label Loyalty (WLL) Core Marketing API enables developers to register app installations and report installation attributes. Reporting this data empowers business stakeholders to analyze, segment and prepare highly targeted marketing for their userbase via WLL’s easy to use backend console.
Getting Started
Once you have received your API Key you can begin using the API. The key should be included in all API requests as the value of X-Api-Key
header. The first step to handling a new app installation is registering with a notification transport provider, you should then pass the transport details to the installation registration endpoint.
Once an installation is registered it is then possible to start passing attributes for the installation. These attributes will allow administrators to segment installations based on combining attribute filters.
Installation ¶
Installations Collection ¶
Headers
Content-Type: application/json
Body
{
"transport": "DEFAULT",
"transportId": "z5hk3hu864sn6uui24qpwe",
"userId": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50"
}
Headers
Content-Type: application/json; charset=utf-8
Body
{
"status": "success",
"data": {
"installation": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"transport": "DEFAULT",
"transportId": "z5hk3hu864sn6uui24qpwe"
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"installation": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"transport": {
"type": "string",
"enum": [
"DEFAULT",
"ONESIGNAL",
"FIREBASE"
]
},
"transportId": {
"type": "string"
}
},
"required": [
"transport",
"transportId"
]
}
}
}
}
}
Create an InstallationPOST/installations
Register a new app installation. This represents a push notification target to which arbitrary attributes can be attached. A single user may have many installations if they have used the app on multiple devices or installed the app on the same device multiple times.
The transport
property should be set to the push notification transport network being used and transportId
should be set to the target ID provided by that transport network.
This endpoint is usually only called directly by the device where the installation is being registered since the transportId
is otherwise not usually known.
Installation Attributes ¶
Headers
Content-Type: application/json
Body
{
"definition": {
"name": "Anniversary",
"type": "DATETIME"
},
"value": "2018-01-01T00:00:00.000Z"
}
Headers
Content-Type: application/json; charset=utf-8
Body
{
"status": "success",
"data": {
"attribute": {
"installation": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"transport": "DEFAULT",
"transportId": "z5hk3hu864sn6uui24qpwe"
},
"attribute": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Anniversary",
"type": "DATETIME"
},
"value": "Hello, world!"
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"attribute": {
"type": "object",
"properties": {
"installation": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"transport": {
"type": "string",
"enum": [
"DEFAULT",
"ONESIGNAL",
"FIREBASE"
]
},
"transportId": {
"type": "string"
}
},
"required": [
"transport",
"transportId"
]
},
"attribute": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"DATETIME",
"STRING",
"NUMBER",
"BOOLEAN"
]
}
},
"required": [
"name",
"type"
]
},
"value": {
"type": "string"
}
}
}
}
}
}
}
Create an Installation AttributePOST/installations/{id}/attributes
Register a new attribute for an installation. An installation attribute defines some data to attach to the installation, this data can then be used to filter installations when targeting a particular subset of installations for delivering messages.
The definition
object provides information about what kind of attribute is being registered, including what the name of the attribute and the type of data. The name may contain arbitrary alphanumeric characters and will be used throughout the console to visually represent the attribute.
The valid values for type
are listed below. The type specified will dictate the behaviour and available operations when filtering.
"STRING"
"NUMBER"
"DATETIME"
"BOOLEAN"
The data type of the value
property varies depending on the configured definition.type
.
- id
uuid
(required) Example: 540e9505-762e-4632-95b7-f8c950b13311ID of the Installation
User ¶
User Attributes ¶
Headers
Content-Type: application/json
Body
{
"definition": {
"name": "Anniversary",
"type": "DATETIME"
},
"value": "2018-01-01T00:00:00.000Z"
}
Headers
Content-Type: application/json; charset=utf-8
Body
[
{
"installation": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"transport": "DEFAULT",
"transportId": "z5hk3hu864sn6uui24qpwe"
},
"attribute": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Anniversary",
"type": "DATETIME"
},
"value": "Hello, world!"
}
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
Create User AttributesPOST/users/{id}/attributes
Register a new attribute for all installations which are linked to a specific user.
This attribute data can then be used to filter installations when targeting a particular subset of installations for delivering messages.
The definition
object provides information about what kind of attribute is being registered, including what the name of the attribute and the type of data. The name may contain arbitrary alphanumeric characters and will be used throughout the console to visually represent the attribute.
The valid values for type
are listed below. The type specified will dictate the behaviour and available operations when filtering.
"STRING"
"NUMBER"
"DATETIME"
"BOOLEAN"
The data type of the value
property varies depending on the configured definition.type.
- id
uuid
(required) Example: 2c7c8ad6-9a4e-49b2-bb33-2e38ad003501ID of the User as was specified when registering the installation.
Campaign ¶
Campaigns Collection ¶
Headers
Content-Type: application/json
Body
{
"name": "Black Friday Deal",
"notification": {
"title": "Amazing deals on Black Friday",
"body": "Come to the store on Friday to checkout our amazing deals",
"pictureUrl": "https://example.com/image.png",
"url": "https://www.google.com",
"screen": "ScreenName?param=value"
},
"sendAfter": "2017-11-11T08:00:00.000Z",
"sendBefore": "2017-12-01T00:00:00.000Z",
"repetitionInterval": "DAY",
"intelligentDelivery": false,
"segments": [
{
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50"
}
]
}
Headers
Content-Type: application/json; charset=utf-8
Body
{
"status": "success",
"data": {
"campaign": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Black Friday Deal",
"notification": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"title": "Amazing deals on Black Friday",
"body": "Come to the store on Friday to checkout our amazing deals",
"pictureUrl": "https://example.com/image.png",
"url": "https://www.google.com",
"screen": "ScreenName?param=value"
},
"sendAfter": "2017-11-11T08:00:00.000Z",
"repeat": "DAY",
"intelligentDelivery": true,
"deliveries": [
{
"sentAt": "2017-11-11T06:00:00.000Z",
"metrics": {
"pending": 823,
"failed": 3,
"opened": 1259
}
}
],
"createdAt": "2017-11-11T06:00:00.000Z",
"updatedAt": "2017-11-11T06:00:00.000Z"
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"campaign": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"notification": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"body": {
"type": "string"
},
"pictureUrl": {
"type": "string"
},
"url": {
"type": "string"
},
"screen": {
"type": "string"
}
},
"required": [
"title"
]
},
"sendAfter": {
"type": "string"
},
"repeat": {
"type": "string",
"enum": [
"DAY",
"WEEK",
"MONTH"
]
},
"intelligentDelivery": {
"type": "boolean"
},
"deliveries": {
"type": "array"
},
"createdAt": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
},
"required": [
"name",
"sendAfter",
"repeat",
"intelligentDelivery"
]
}
}
}
}
}
Create a CampaignPOST/campaigns
Create a new Campaign.
Fields
name
provides a human-readable way to reference the campaign internally.
notification
controls the public face of the campaign, what will actually be delivered to users.
sendAfter
controls when the campaign should start to be delivered.
sendBefore
controls the latest possible time the campaign could be delivered, this is only needed if you are setting up a campaign with repeat deliveries.
repetitionInterval
controls how the campaign delivery should be repeated if at all. It may be null
or one of DAY
, WEEK
, MONTH
.
segments
provides a list of which segments this campaign should be sent to.
Headers
X-Api-Key: $api_key
Authorization: Bearer $access_token
Headers
Content-Type: application/json; charset=utf-8
Body
[
{
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Black Friday Deal",
"notification": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"title": "Amazing deals on Black Friday",
"body": "Come to the store on Friday to checkout our amazing deals",
"pictureUrl": "https://example.com/image.png",
"url": "https://www.google.com",
"screen": "ScreenName?param=value"
},
"sendAfter": "2017-11-11T08:00:00.000Z",
"repetitionInterval": "DAY",
"intelligentDelivery": false,
"deliveries": [],
"segments": []
}
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
List all CampaignsGET/campaigns{?limit,skip,sort,order,filter}
Get a list of all campaigns which your token is authorized to view.
Filtering
It is possible to apply basic filter conditions to the result set using the filter
query parameter. This parameter accepts an O-Rison encoded JSON object expressing the set of conditions to be applied.
The general format of this filter object (expressed in JSON) is as follows:
{
"field1": { "operator": "value" },
"field2": { "operator": "value" }
}
Where field1
and field2
are field names of this entity, operator
is one of [eq
, neq
, gt
, lt
, in
, has
, like
], and "value"
is the exact value to compare against. The like operator accepts a wild card %
which means it will accept any value in place of it e.g %App%
will find Web App
, the like operator also isn’t case sensitive. The value need not necessarily be a string, the type appropriate for the field should be used. See the O-Rison documentation for help on how to format other types. Dates and datetimes should be passed as ISO 8601 strings.
The same filter encoded as O-Rison would be as follows:
field1:(operator:'value'),field2:(operator:'value')
When using the in
operator the value should be an array.
Arrays are expressed by enclosing a comma separated list of elements within !()
.
For example:
field3:(in:!('value1','value2'))
- limit
number
(optional) Example: 10The number of items to retrieve.
- skip
number
(optional) Example: 0The number of items to skip before selecting.
- sort
string
(optional) Example: idThe property to use for sorting.
Choices:
id
name
sendAfter
sendBefore
repetitionInterval
- order
string
(optional) Example: ASCThe order to sort items.
Choices:
ASC
DESC
- filter
string
(optional) Example: sendAfter:(gt:'2019-01-01T00:00:00')O-Rison encoded filter string
Individual Campaign ¶
Headers
Content-Type: application/json; charset=utf-8
Body
{
"status": "success",
"data": {
"campaign": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Black Friday Deal",
"notification": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"title": "Amazing deals on Black Friday",
"body": "Come to the store on Friday to checkout our amazing deals",
"pictureUrl": "https://example.com/image.png",
"url": "https://www.google.com",
"screen": "ScreenName?param=value"
},
"sendAfter": "2017-11-11T08:00:00.000Z",
"repetitionInterval": "DAY",
"intelligentDelivery": false,
"deliveries": [],
"segments": []
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"campaign": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"notification": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"body": {
"type": "string"
},
"pictureUrl": {
"type": "string"
},
"url": {
"type": "string"
},
"screen": {
"type": "string"
}
},
"required": [
"title"
]
},
"sendAfter": {
"type": "string"
},
"repetitionInterval": {
"type": "string",
"enum": [
"DAY",
"WEEK",
"MONTH"
]
},
"intelligentDelivery": {
"type": "boolean"
},
"deliveries": {
"type": "array"
},
"segments": {
"type": "array"
}
},
"required": [
"name",
"sendAfter",
"repetitionInterval",
"intelligentDelivery"
]
}
}
}
}
}
View a CampaignGET/campaigns/{campaign_id}
View the details of a single campaign.
- campaign_id
uuid
(required) Example: 99afedd5-75de-4833-88cc-a0caf485e354ID of the Campaign
Headers
Content-Type: application/json
Body
{
"name": "Black Friday Deal",
"notification": {
"title": "Amazing deals on Black Friday",
"body": "Come to the store on Friday to checkout our amazing deals",
"pictureUrl": "https://example.com/image.png",
"url": "https://www.google.com",
"screen": "ScreenName?param=value"
},
"sendAfter": "2017-11-11T08:00:00.000Z",
"sendBefore": "2017-12-01T00:00:00.000Z",
"repetitionInterval": "DAY",
"intelligentDelivery": false,
"segments": [
{
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50"
}
]
}
Headers
Content-Type: application/json; charset=utf-8
Body
{
"status": "success",
"data": {
"campaign": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Black Friday Deal",
"notification": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"title": "Amazing deals on Black Friday",
"body": "Come to the store on Friday to checkout our amazing deals",
"pictureUrl": "https://example.com/image.png",
"url": "https://www.google.com",
"screen": "ScreenName?param=value"
},
"sendAfter": "2017-11-11T08:00:00.000Z",
"repeat": "DAY",
"intelligentDelivery": true,
"deliveries": [
{
"sentAt": "2017-11-11T06:00:00.000Z",
"metrics": {
"pending": 823,
"failed": 3,
"opened": 1259
}
}
],
"createdAt": "2017-11-11T06:00:00.000Z",
"updatedAt": "2017-11-11T06:00:00.000Z"
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"campaign": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"notification": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"body": {
"type": "string"
},
"pictureUrl": {
"type": "string"
},
"url": {
"type": "string"
},
"screen": {
"type": "string"
}
},
"required": [
"title"
]
},
"sendAfter": {
"type": "string"
},
"repeat": {
"type": "string",
"enum": [
"DAY",
"WEEK",
"MONTH"
]
},
"intelligentDelivery": {
"type": "boolean"
},
"deliveries": {
"type": "array"
},
"createdAt": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
},
"required": [
"name",
"sendAfter",
"repeat",
"intelligentDelivery"
]
}
}
}
}
}
Update a CampaignPATCH/campaigns/{campaign_id}
Update the details of a single campaign.
- campaign_id
uuid
(required) Example: 99afedd5-75de-4833-88cc-a0caf485e354ID of the Campaign
Individual Campaign Deliveries ¶
Headers
Content-Type: application/json; charset=utf-8
Body
{
"status": "success",
"data": [
{
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"sentAt": "2017-11-11T06:00:00.000Z",
"metrics": {
"pending": 823,
"failed": 3,
"opened": 1259
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"data": {
"type": "array"
}
}
}
View Campaign DeliveriesGET/campaigns/{campaign_id}/deliveries
View a list of all deliveries of a single campaign.
- campaign_id
uuid
(required) Example: 99afedd5-75de-4833-88cc-a0caf485e354ID of the Campaign
Segment ¶
Segments Collection ¶
Headers
Content-Type: application/json
Body
{
"name": "Women Over 21",
"filters": [
{
"attribute": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Anniversary",
"type": "DATETIME"
},
"comparator": "EQ",
"value": "21"
}
]
}
Headers
Content-Type: application/json; charset=utf-8
Body
{
"status": "success",
"data": {
"segment": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Women Over 21",
"filters": [
{
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"attribute": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Anniversary",
"type": "DATETIME"
},
"comparator": "EQ",
"value": "21"
}
],
"isArchived": false
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"segment": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"filters": {
"type": "array"
},
"isArchived": {
"type": "boolean"
}
},
"required": [
"name"
]
}
}
}
}
}
Create a SegmentPOST/segments
Create a new Segment.
Filter Fields
Each defined filter has the following fields:
attribute
controls which attribute should be filtered against only the child ID field need be passed.
comparator
controls how to compare the attribute to the provided value. Possible compartors are EQ
, NEQ
, LT
, GT
.
value
provides the value to filter against in combination with the comparator.
Headers
Content-Type: application/json; charset=utf-8
Body
[
{
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Women Over 21",
"filters": [
{
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Over 21",
"attribute": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Anniversary",
"type": "DATETIME"
},
"comparator": "EQ",
"value": "21",
"audience": 3872
}
],
"audience": 794,
"isArchived": false
}
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
List All SegmentsGET/segments
Get a list of all segments which your token is authorized to view.
Individual Segment ¶
Headers
Content-Type: application/json; charset=utf-8
Body
{
"status": "success",
"data": {
"segment": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Women Over 21",
"filters": [
{
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Over 21",
"attribute": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Anniversary",
"type": "DATETIME"
},
"comparator": "EQ",
"value": "21",
"audience": 3872
}
],
"audience": 794,
"isArchived": false
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"segment": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"filters": {
"type": "array"
},
"audience": {
"type": "number"
},
"isArchived": {
"type": "boolean"
}
},
"required": [
"name"
]
}
}
}
}
}
View a SegmentGET/segments/{segment_id}
View the details of a single segment.
- segment_id
uuid
(required) Example: e866b14f-2b7f-4ab4-a739-65eca562eaf9ID of the Segment.
Headers
Content-Type: application/json
Body
{
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Women Over 21",
"filters": [
{
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Over 21",
"attribute": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Anniversary",
"type": "DATETIME"
},
"comparator": "EQ",
"value": "21",
"audience": 3872
}
],
"audience": 794,
"isArchived": false
}
Headers
Content-Type: application/json; charset=utf-8
Body
{
"status": "success",
"data": {
"segment": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Women Over 21",
"filters": [
{
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Over 21",
"attribute": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Anniversary",
"type": "DATETIME"
},
"comparator": "EQ",
"value": "21",
"audience": 3872
}
],
"audience": 794,
"isArchived": false
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"segment": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"filters": {
"type": "array"
},
"audience": {
"type": "number"
},
"isArchived": {
"type": "boolean"
}
},
"required": [
"name"
]
}
}
}
}
}
Update a SegmentPATCH/segments/{segment_id}
Update the details of a single segment.
- segment_id
uuid
(required) Example: e866b14f-2b7f-4ab4-a739-65eca562eaf9ID of the Segment
Headers
Content-Type: application/json
Body
{
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Women Over 21",
"filters": [
{
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Over 21",
"attribute": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Anniversary",
"type": "DATETIME"
},
"comparator": "EQ",
"value": "21",
"audience": 3872
}
],
"audience": 794,
"isArchived": false
}
Headers
Content-Type: application/json; charset=utf-8
Body
{
"status": "success",
"data": {
"segment": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Women Over 21",
"filters": [
{
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"attribute": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Anniversary",
"type": "DATETIME"
},
"comparator": "EQ",
"value": "21"
}
],
"isArchived": "true"
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"segment": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"filters": {
"type": "array"
},
"isArchived": {
"type": "string"
}
},
"required": [
"name"
]
}
}
}
}
}
Delete a SegmentDELETE/segments/{segment_id}
Delete single segment.
- segment_id
uuid
(required) Example: e866b14f-2b7f-4ab4-a739-65eca562eaf9ID of the Segment
Attribute ¶
Attributes Collection ¶
Headers
Content-Type: application/json; charset=utf-8
Body
[
{
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Anniversary",
"type": "DATETIME"
}
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
List all AttributesGET/attributes
Get a list of all attributes which have been defined for any of the installations.
Individual Attribute ¶
Headers
Content-Type: application/json; charset=utf-8
Body
{
"status": "success",
"data": {
"attribute": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Anniversary",
"type": "DATETIME"
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"attribute": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"DATETIME",
"STRING",
"NUMBER",
"BOOLEAN"
]
}
},
"required": [
"name",
"type"
]
}
}
}
}
}
View an AttributeGET/attributes/{attribute_id}
View the details of a single attribute.
- attribute_id
uuid
(required) Example: 2d1b6016-59f2-4dc1-9142-052973404c37ID of the Attribute
Admin ¶
statistics ¶
Headers
Content-Type: application/json; charset=utf-8
Body
{
"status": "success",
"data": {
"statistics": {
"installations": 8,
"conversionRatio": 0.049911,
"campaigns": 11,
"deliveredCampaigns": 9,
"pendingCampaigns": 2
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"statistics": {
"type": "object",
"properties": {
"installations": {
"type": "number"
},
"conversionRatio": {
"type": "number"
},
"campaigns": {
"type": "number"
},
"deliveredCampaigns": {
"type": "number"
},
"pendingCampaigns": {
"type": "number"
}
}
}
}
}
}
}
View Aggregated StatisticsGET/statistics
Get a set of aggregated statistics about your use of the marketing module.
Month By Month Statistics For Deliveries ¶
Headers
Content-Type: application/json; charset=utf-8
Body
[
{
"month": "Apr",
"sent": 5,
"failed": 1,
"opened": 2,
"unopened": 3
}
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
View Delivery Statistics ReportGET/statistics/deliveries
Get a list of delivery statistics aggregated month by month.
Webhook ¶
Webhook Collection ¶
Headers
Content-Type: application/json
Body
{
"name": "name of webhook",
"description": "description of webhook",
"notification": {
"title": "Amazing deals on Black Friday",
"body": "Come to the store on Friday to checkout our amazing deals",
"pictureUrl": "https://example.com/image.png",
"url": "https://www.google.com",
"screen": "ScreenName?param=value"
}
}
Headers
Content-Type: application/json; charset=utf-8
Body
{
"status": "success",
"data": {
"webhook": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "name of webhook",
"description": "description of webhook",
"notification": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"title": "Amazing deals on Black Friday",
"body": "Come to the store on Friday to checkout our amazing deals",
"pictureUrl": "https://example.com/image.png",
"url": "https://www.google.com",
"screen": "ScreenName?param=value"
},
"availability": {
"start": "2018-06-08T18:19:10.878Z",
"end": "null"
}
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"webhook": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"notification": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"body": {
"type": "string"
},
"pictureUrl": {
"type": "string"
},
"url": {
"type": "string"
},
"screen": {
"type": "string"
}
},
"required": [
"title"
]
},
"availability": {
"type": "object",
"properties": {
"start": {
"type": "string"
},
"end": {
"type": "string"
}
}
}
},
"required": [
"name",
"description"
]
}
}
}
}
}
Create a WebhookPOST/webhooks
Create a new Webhook. This represents a marketing message which can be triggered at any time by making an API call with the filter constraints.
Headers
Content-Type: application/json; charset=utf-8
Body
[
{
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "name of webhook",
"description": "description of webhook",
"notification": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"title": "Amazing deals on Black Friday",
"body": "Come to the store on Friday to checkout our amazing deals",
"pictureUrl": "https://example.com/image.png",
"url": "https://www.google.com",
"screen": "ScreenName?param=value"
},
"availability": {
"start": "2018-06-08T18:19:10.878Z",
"end": "null"
}
}
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
List all WebhooksGET/webhooks
Get a list of all webhooks which your token is authorized to view.
Individual Webhook ¶
Headers
Content-Type: application/json; charset=utf-8
Body
{
"status": "success",
"data": {
"webhook": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "name of webhook",
"description": "description of webhook",
"notification": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"title": "Amazing deals on Black Friday",
"body": "Come to the store on Friday to checkout our amazing deals",
"pictureUrl": "https://example.com/image.png",
"url": "https://www.google.com",
"screen": "ScreenName?param=value"
},
"availability": {
"start": "2018-06-08T18:19:10.878Z",
"end": "null"
}
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"webhook": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"notification": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"body": {
"type": "string"
},
"pictureUrl": {
"type": "string"
},
"url": {
"type": "string"
},
"screen": {
"type": "string"
}
},
"required": [
"title"
]
},
"availability": {
"type": "object",
"properties": {
"start": {
"type": "string"
},
"end": {
"type": "string"
}
}
}
},
"required": [
"name",
"description"
]
}
}
}
}
}
View a WebhookGET/webhooks/{webhook_id}
View the details of a single webhook.
- webhook_id
uuid
(required) Example: 2cba78db-90d6-4786-9715-fe1ffaa74fe4ID of the Webhook
Headers
Content-Type: application/json
Body
{
"name": "name of webhook",
"description": "description of webhook",
"notification": {
"title": "Amazing deals on Black Friday",
"body": "Come to the store on Friday to checkout our amazing deals",
"pictureUrl": "https://example.com/image.png",
"url": "https://www.google.com",
"screen": "ScreenName?param=value"
}
}
Headers
Content-Type: application/json; charset=utf-8
Body
{
"status": "success",
"data": {
"webhook": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "name of webhook",
"description": "description of webhook",
"notification": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"title": "Amazing deals on Black Friday",
"body": "Come to the store on Friday to checkout our amazing deals",
"pictureUrl": "https://example.com/image.png",
"url": "https://www.google.com",
"screen": "ScreenName?param=value"
},
"availability": {
"start": "2018-06-08T18:19:10.878Z",
"end": "null"
}
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"webhook": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"notification": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"body": {
"type": "string"
},
"pictureUrl": {
"type": "string"
},
"url": {
"type": "string"
},
"screen": {
"type": "string"
}
},
"required": [
"title"
]
},
"availability": {
"type": "object",
"properties": {
"start": {
"type": "string"
},
"end": {
"type": "string"
}
}
}
},
"required": [
"name",
"description"
]
}
}
}
}
}
Update a WebhookPATCH/webhooks/{webhook_id}
Update the details of a single webhook.
- webhook_id
uuid
(required) Example: 99afedd5-75de-4833-88cc-a0caf485e354ID of the Webhook
Headers
Content-Type: application/json
X-Api-Key: $api_key
Body
{
"filters": [
{
"attribute": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Anniversary",
"type": "DATETIME"
},
"comparator": "EQ",
"value": "2018-01-01T00:00:00Z"
}
]
}
Headers
Content-Type: application/json; charset=utf-8
Body
{
"status": "success",
"data": {
"webhookInvocation": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"createdAt": "2017-11-11T08:00:00.000Z",
"filters": [
{
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Over 21",
"attribute": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "Anniversary",
"type": "DATETIME"
},
"comparator": "EQ",
"value": "21",
"audience": 3872
}
],
"webhook": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "name of webhook",
"description": "description of webhook",
"notification": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"title": "Amazing deals on Black Friday",
"body": "Come to the store on Friday to checkout our amazing deals",
"pictureUrl": "https://example.com/image.png",
"url": "https://www.google.com",
"screen": "ScreenName?param=value"
},
"availability": {
"start": "2018-06-08T18:19:10.878Z",
"end": "null"
}
}
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"webhookInvocation": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"filters": {
"type": "array"
},
"webhook": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"notification": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"body": {
"type": "string"
},
"pictureUrl": {
"type": "string"
},
"url": {
"type": "string"
},
"screen": {
"type": "string"
}
},
"required": [
"title"
]
},
"availability": {
"type": "object",
"properties": {
"start": {
"type": "string"
},
"end": {
"type": "string"
}
}
}
},
"required": [
"name",
"description"
]
}
},
"required": [
"createdAt"
]
}
}
}
}
}
Invoke a WebhookPOST/webhooks/{webhook_id}/invocations
You can use this endpoint to invoke a webhook and send a predefined message to any installations which match the ad-hoc filters passed in the body of the request. Multiple filters can be combined in the same way as used to define a segment.
- webhook_id
uuid
(required) Example: 99afedd5-75de-4833-88cc-a0caf485e354ID of the Webhook
Headers
Content-Type: application/json
Headers
Content-Type: application/json; charset=utf-8
Body
{
"status": "success",
"data": {
"webhook": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"name": "name of webhook",
"description": "description of webhook",
"notification": {
"id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
"title": "Amazing deals on Black Friday",
"body": "Come to the store on Friday to checkout our amazing deals",
"pictureUrl": "https://example.com/image.png",
"url": "https://www.google.com",
"screen": "ScreenName?param=value"
},
"availability": {
"start": "2018-06-08T18:19:10.878Z",
"end": "2018-06-09T18:19:10.878Z"
}
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"webhook": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"notification": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"body": {
"type": "string"
},
"pictureUrl": {
"type": "string"
},
"url": {
"type": "string"
},
"screen": {
"type": "string"
}
},
"required": [
"title"
]
},
"availability": {
"type": "object",
"properties": {
"start": {
"type": "string"
},
"end": {
"type": "string"
}
}
}
},
"required": [
"name",
"description"
]
}
}
}
}
}
Delete a WebhookDELETE/webhooks/{webhook_id}
Delete single webhook.
- webhook_id
uuid
(required) Example: 99afedd5-75de-4833-88cc-a0caf485e354ID of the Webhook
Generated by aglio on 19 Nov 2024