REST API
Use the REST API to add new participants, trigger loyalty actions, get campaign data, and get participant data from a secure environment.
Getting started
Note: The REST API is only available to users on a LoyaltySurf paid plan.
Step 1: Get your API key
Go to your LoyaltySurf Account page
Generate a new API key (if you don't already have one) or click on your existing API key to copy it to your clipboard
Your API key holds many privileges, so be sure to keep it secure! Do not share your API key in publicly accessible areas such as GitHub, Bitbucket, Web Browsers, and Front End client code.
Do not use the RESTful API in browser applications. Exposing your secret API key within front end code exposes it to security risks. Anybody with a bit of programming knowledge could potentially hijack your API key and begin making requests on your behalf.
Step 2: Set up authentication
The LoyaltySurf REST API uses your API key to authenticate requests. Here's how to set up authentication:
Set a plain text header named
Authorization
with the contents beingBearer <YOUR_API_ACCESS_KEY>
where<YOUR_API_ACCESS_KEY>
is your API key.
Example Authenticated Request
Base URL
All endpoints for the LoyaltySurf REST API start with the same base URL:
Next steps
Last updated