cURL
curl --request GET \
--url https://api.loyaltylion.com/v2/activities \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.loyaltylion.com/v2/activities"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.loyaltylion.com/v2/activities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.loyaltylion.com/v2/activities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.loyaltylion.com/v2/activities"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.loyaltylion.com/v2/activities")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loyaltylion.com/v2/activities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"activities": [
{
"id": 123,
"merchant_id": "<string>",
"value": 123,
"state": "pending",
"customer": {
"id": 123,
"merchant_id": "<string>",
"email": "<string>",
"points_pending": 123,
"points_approved": 123,
"points_spent": 123
},
"created_at": "<string>",
"rule": {
"id": 123,
"name": "<string>",
"title": "<string>"
},
"flow": {
"id": 123,
"journey_id": 123,
"name": "<string>",
"block_id": "<string>"
}
}
],
"cursor": {
"prev": "<string>",
"next": "<string>"
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"details": {}
}
}Activities
List Activities
GET
/
v2
/
activities
cURL
curl --request GET \
--url https://api.loyaltylion.com/v2/activities \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.loyaltylion.com/v2/activities"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.loyaltylion.com/v2/activities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.loyaltylion.com/v2/activities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.loyaltylion.com/v2/activities"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.loyaltylion.com/v2/activities")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loyaltylion.com/v2/activities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"activities": [
{
"id": 123,
"merchant_id": "<string>",
"value": 123,
"state": "pending",
"customer": {
"id": 123,
"merchant_id": "<string>",
"email": "<string>",
"points_pending": 123,
"points_approved": 123,
"points_spent": 123
},
"created_at": "<string>",
"rule": {
"id": 123,
"name": "<string>",
"title": "<string>"
},
"flow": {
"id": 123,
"journey_id": 123,
"name": "<string>",
"block_id": "<string>"
}
}
],
"cursor": {
"prev": "<string>",
"next": "<string>"
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"details": {}
}
}Activities in LoyaltyLion represent actions that added or removed points from a
customer. These are most commonly triggered by a Rule, such as giving points for
placing an order or enrolling in the program, but can also be created in other
situations such as manual point adjustments or point expirations.
Authorizations
ProgramApiKeySiteTokenSecret
An API key linked to a Program in LoyaltyLion, with a set of permissions (scopes). API keys can be created manually, or acquired through an OAuth2 flow. The API key should be provided as a Bearer token in the Authorization header
Query Parameters
Return only resources whose id is after the specified id
Required range:
x >= 0Max number of resources to return per request
Required range:
1 <= x <= 500Fetch another page of results. This field is deprecated and will be removed in a future version of the API. Use cursors for pagination instead
Required range:
x >= 1Fetch another page of results using a cursor returned in a previous response
Return only activities created on or after the specified ISO 8601 datetime string
Return only activities created before the specified ISO 8601 datetime string