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
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
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
curl -X "GET" "https://api.loyaltysurf.io/v1/campaign/4pdlhb" -H "Authorization: Bearer TWZ4X4NXESMX03MT66HHS6Z9Z91E"
Base URL
All endpoints for the LoyaltySurf REST API start with the same base URL:
https://api.loyaltysurf.io/v1
Next steps
Last updated
Was this helpful?