WLL Marketing Core API

Introduction

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

POST api.marketing.wlloyalty.net/v1/installations
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "transport": "DEFAULT",
  "transportId": "z5hk3hu864sn6uui24qpwe",
  "userId": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50"
}
Responses201
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "status": "success",
  "data": {
    "installation": {
      "id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
      "transport": "DEFAULT",
      "transportId": "z5hk3hu864sn6uui24qpwe"
    }
  }
}
Schema
HideShow
{
  "$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 Installation
POST/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

POST api.marketing.wlloyalty.net/v1/installations/540e9505-762e-4632-95b7-f8c950b13311/attributes
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "definition": {
    "name": "Anniversary",
    "type": "DATETIME"
  },
  "value": "2018-01-01T00:00:00.000Z"
}
Responses201
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
HideShow
{
  "$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 Attribute
POST/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.

URI Parameters
HideShow
id
uuid (required) Example: 540e9505-762e-4632-95b7-f8c950b13311

ID of the Installation


User

User Attributes

POST api.marketing.wlloyalty.net/v1/users/2c7c8ad6-9a4e-49b2-bb33-2e38ad003501/attributes
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "definition": {
    "name": "Anniversary",
    "type": "DATETIME"
  },
  "value": "2018-01-01T00:00:00.000Z"
}
Responses201
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
HideShow
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Create User Attributes
POST/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.

URI Parameters
HideShow
id
uuid (required) Example: 2c7c8ad6-9a4e-49b2-bb33-2e38ad003501

ID of the User as was specified when registering the installation.


Campaign

Campaigns Collection

POST api.marketing.wlloyalty.net/v1/campaigns
Requestsexample 1
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"
    }
  ]
}
Responses201
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
HideShow
{
  "$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 Campaign
POST/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.


GET api.marketing.wlloyalty.net/v1/campaigns?limit=10&skip=0&sort=id&order=ASC&filter=sendAfter:(gt:'2019-01-01T00:00:00')
RequestsDefault
Headers
X-Api-Key: $api_key
Authorization: Bearer $access_token
Responses200
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
HideShow
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

List all Campaigns
GET/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'))
URI Parameters
HideShow
limit
number (optional) Example: 10

The number of items to retrieve.

skip
number (optional) Example: 0

The number of items to skip before selecting.

sort
string (optional) Example: id

The property to use for sorting.

Choices: id name sendAfter sendBefore repetitionInterval

order
string (optional) Example: ASC

The 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

GET api.marketing.wlloyalty.net/v1/campaigns/99afedd5-75de-4833-88cc-a0caf485e354
Responses200
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
HideShow
{
  "$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 Campaign
GET/campaigns/{campaign_id}

View the details of a single campaign.

URI Parameters
HideShow
campaign_id
uuid (required) Example: 99afedd5-75de-4833-88cc-a0caf485e354

ID of the Campaign


PATCH api.marketing.wlloyalty.net/v1/campaigns/99afedd5-75de-4833-88cc-a0caf485e354
Requestsexample 1
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"
    }
  ]
}
Responses200
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
HideShow
{
  "$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 Campaign
PATCH/campaigns/{campaign_id}

Update the details of a single campaign.

URI Parameters
HideShow
campaign_id
uuid (required) Example: 99afedd5-75de-4833-88cc-a0caf485e354

ID of the Campaign


Individual Campaign Deliveries

GET api.marketing.wlloyalty.net/v1/campaigns/99afedd5-75de-4833-88cc-a0caf485e354/deliveries
Responses200
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
HideShow
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "status": {
      "type": "string"
    },
    "data": {
      "type": "array"
    }
  }
}

View Campaign Deliveries
GET/campaigns/{campaign_id}/deliveries

View a list of all deliveries of a single campaign.

URI Parameters
HideShow
campaign_id
uuid (required) Example: 99afedd5-75de-4833-88cc-a0caf485e354

ID of the Campaign


Segment

Segments Collection

POST api.marketing.wlloyalty.net/v1/segments
Requestsexample 1
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"
    }
  ]
}
Responses201
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
HideShow
{
  "$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 Segment
POST/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.


GET api.marketing.wlloyalty.net/v1/segments
Responses200
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
HideShow
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

List All Segments
GET/segments

Get a list of all segments which your token is authorized to view.


Individual Segment

GET api.marketing.wlloyalty.net/v1/segments/e866b14f-2b7f-4ab4-a739-65eca562eaf9
Responses200
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
HideShow
{
  "$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 Segment
GET/segments/{segment_id}

View the details of a single segment.

URI Parameters
HideShow
segment_id
uuid (required) Example: e866b14f-2b7f-4ab4-a739-65eca562eaf9

ID of the Segment.


PATCH api.marketing.wlloyalty.net/v1/segments/e866b14f-2b7f-4ab4-a739-65eca562eaf9
Requestsexample 1
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
}
Responses200
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
HideShow
{
  "$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 Segment
PATCH/segments/{segment_id}

Update the details of a single segment.

URI Parameters
HideShow
segment_id
uuid (required) Example: e866b14f-2b7f-4ab4-a739-65eca562eaf9

ID of the Segment


DELETE api.marketing.wlloyalty.net/v1/segments/e866b14f-2b7f-4ab4-a739-65eca562eaf9
Requestsexample 1
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
}
Responses200
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
HideShow
{
  "$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 Segment
DELETE/segments/{segment_id}

Delete single segment.

URI Parameters
HideShow
segment_id
uuid (required) Example: e866b14f-2b7f-4ab4-a739-65eca562eaf9

ID of the Segment


Attribute

Attributes Collection

GET api.marketing.wlloyalty.net/v1/attributes
Responses200
Headers
Content-Type: application/json; charset=utf-8
Body
[
  {
    "id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
    "name": "Anniversary",
    "type": "DATETIME"
  }
]
Schema
HideShow
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

List all Attributes
GET/attributes

Get a list of all attributes which have been defined for any of the installations.


Individual Attribute

GET api.marketing.wlloyalty.net/v1/attributes/2d1b6016-59f2-4dc1-9142-052973404c37
Responses200
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "status": "success",
  "data": {
    "attribute": {
      "id": "8d68cb91-202a-4c62-a867-8f9a8a1e2f50",
      "name": "Anniversary",
      "type": "DATETIME"
    }
  }
}
Schema
HideShow
{
  "$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 Attribute
GET/attributes/{attribute_id}

View the details of a single attribute.

URI Parameters
HideShow
attribute_id
uuid (required) Example: 2d1b6016-59f2-4dc1-9142-052973404c37

ID of the Attribute


Admin

statistics

GET api.marketing.wlloyalty.net/v1/statistics
Responses200
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
HideShow
{
  "$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 Statistics
GET/statistics

Get a set of aggregated statistics about your use of the marketing module.


Month By Month Statistics For Deliveries

GET api.marketing.wlloyalty.net/v1/statistics/deliveries
Responses200
Headers
Content-Type: application/json; charset=utf-8
Body
[
  {
    "month": "Apr",
    "sent": 5,
    "failed": 1,
    "opened": 2,
    "unopened": 3
  }
]
Schema
HideShow
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

View Delivery Statistics Report
GET/statistics/deliveries

Get a list of delivery statistics aggregated month by month.


Webhook

Webhook Collection

POST api.marketing.wlloyalty.net/v1/webhooks
Requestsexample 1
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"
  }
}
Responses201
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
HideShow
{
  "$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 Webhook
POST/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.


GET api.marketing.wlloyalty.net/v1/webhooks
Responses200
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
HideShow
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

List all Webhooks
GET/webhooks

Get a list of all webhooks which your token is authorized to view.


Individual Webhook

GET api.marketing.wlloyalty.net/v1/webhooks/2cba78db-90d6-4786-9715-fe1ffaa74fe4
Responses200
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
HideShow
{
  "$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 Webhook
GET/webhooks/{webhook_id}

View the details of a single webhook.

URI Parameters
HideShow
webhook_id
uuid (required) Example: 2cba78db-90d6-4786-9715-fe1ffaa74fe4

ID of the Webhook


PATCH api.marketing.wlloyalty.net/v1/webhooks/99afedd5-75de-4833-88cc-a0caf485e354
Requestsexample 1
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"
  }
}
Responses200
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
HideShow
{
  "$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 Webhook
PATCH/webhooks/{webhook_id}

Update the details of a single webhook.

URI Parameters
HideShow
webhook_id
uuid (required) Example: 99afedd5-75de-4833-88cc-a0caf485e354

ID of the Webhook


POST api.marketing.wlloyalty.net/v1/webhooks/99afedd5-75de-4833-88cc-a0caf485e354/invocations
RequestsDefault
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"
    }
  ]
}
Responses201
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
HideShow
{
  "$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 Webhook
POST/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.

URI Parameters
HideShow
webhook_id
uuid (required) Example: 99afedd5-75de-4833-88cc-a0caf485e354

ID of the Webhook


DELETE api.marketing.wlloyalty.net/v1/webhooks/99afedd5-75de-4833-88cc-a0caf485e354
Requestsexample 1
Headers
Content-Type: application/json
Responses200
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
HideShow
{
  "$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 Webhook
DELETE/webhooks/{webhook_id}

Delete single webhook.

URI Parameters
HideShow
webhook_id
uuid (required) Example: 99afedd5-75de-4833-88cc-a0caf485e354

ID of the Webhook


Generated by aglio on 17 Sep 2024