Export Audit Logs
curl --request POST \
--url https://api.loyalty.dog/v2/giftcards/audit-logs/export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"format": "csv",
"merchantId": "<string>",
"subjectId": "<string>",
"actorId": "<string>",
"subjectName": "<string>",
"actorName": "<string>",
"merchantName": "<string>",
"actions": [
"<string>"
],
"resourceTypes": [
"<string>"
],
"fromDate": "2023-11-07T05:31:56Z",
"toDate": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.loyalty.dog/v2/giftcards/audit-logs/export"
payload = {
"format": "csv",
"merchantId": "<string>",
"subjectId": "<string>",
"actorId": "<string>",
"subjectName": "<string>",
"actorName": "<string>",
"merchantName": "<string>",
"actions": ["<string>"],
"resourceTypes": ["<string>"],
"fromDate": "2023-11-07T05:31:56Z",
"toDate": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
format: 'csv',
merchantId: '<string>',
subjectId: '<string>',
actorId: '<string>',
subjectName: '<string>',
actorName: '<string>',
merchantName: '<string>',
actions: ['<string>'],
resourceTypes: ['<string>'],
fromDate: '2023-11-07T05:31:56Z',
toDate: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.loyalty.dog/v2/giftcards/audit-logs/export', 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.loyalty.dog/v2/giftcards/audit-logs/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'format' => 'csv',
'merchantId' => '<string>',
'subjectId' => '<string>',
'actorId' => '<string>',
'subjectName' => '<string>',
'actorName' => '<string>',
'merchantName' => '<string>',
'actions' => [
'<string>'
],
'resourceTypes' => [
'<string>'
],
'fromDate' => '2023-11-07T05:31:56Z',
'toDate' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.loyalty.dog/v2/giftcards/audit-logs/export"
payload := strings.NewReader("{\n \"format\": \"csv\",\n \"merchantId\": \"<string>\",\n \"subjectId\": \"<string>\",\n \"actorId\": \"<string>\",\n \"subjectName\": \"<string>\",\n \"actorName\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"fromDate\": \"2023-11-07T05:31:56Z\",\n \"toDate\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.loyalty.dog/v2/giftcards/audit-logs/export")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"format\": \"csv\",\n \"merchantId\": \"<string>\",\n \"subjectId\": \"<string>\",\n \"actorId\": \"<string>\",\n \"subjectName\": \"<string>\",\n \"actorName\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"fromDate\": \"2023-11-07T05:31:56Z\",\n \"toDate\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loyalty.dog/v2/giftcards/audit-logs/export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"format\": \"csv\",\n \"merchantId\": \"<string>\",\n \"subjectId\": \"<string>\",\n \"actorId\": \"<string>\",\n \"subjectName\": \"<string>\",\n \"actorName\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"fromDate\": \"2023-11-07T05:31:56Z\",\n \"toDate\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"taskId": "<string>",
"status": "<string>",
"downloadUrl": "<string>",
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Audit Logs
Export Audit Logs
Export Audit Logs (async bulk export)
Triggers a background task to export audit log entries matching the given filters as CSV or JSON. Only MERCHANT_ADMIN can trigger exports.
Returns immediately with a taskId. Poll
GET /giftcards/audit-logs/export/{taskId} to check status and get the download URL.
POST
/
v2
/
giftcards
/
audit-logs
/
export
Export Audit Logs
curl --request POST \
--url https://api.loyalty.dog/v2/giftcards/audit-logs/export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"format": "csv",
"merchantId": "<string>",
"subjectId": "<string>",
"actorId": "<string>",
"subjectName": "<string>",
"actorName": "<string>",
"merchantName": "<string>",
"actions": [
"<string>"
],
"resourceTypes": [
"<string>"
],
"fromDate": "2023-11-07T05:31:56Z",
"toDate": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.loyalty.dog/v2/giftcards/audit-logs/export"
payload = {
"format": "csv",
"merchantId": "<string>",
"subjectId": "<string>",
"actorId": "<string>",
"subjectName": "<string>",
"actorName": "<string>",
"merchantName": "<string>",
"actions": ["<string>"],
"resourceTypes": ["<string>"],
"fromDate": "2023-11-07T05:31:56Z",
"toDate": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
format: 'csv',
merchantId: '<string>',
subjectId: '<string>',
actorId: '<string>',
subjectName: '<string>',
actorName: '<string>',
merchantName: '<string>',
actions: ['<string>'],
resourceTypes: ['<string>'],
fromDate: '2023-11-07T05:31:56Z',
toDate: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.loyalty.dog/v2/giftcards/audit-logs/export', 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.loyalty.dog/v2/giftcards/audit-logs/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'format' => 'csv',
'merchantId' => '<string>',
'subjectId' => '<string>',
'actorId' => '<string>',
'subjectName' => '<string>',
'actorName' => '<string>',
'merchantName' => '<string>',
'actions' => [
'<string>'
],
'resourceTypes' => [
'<string>'
],
'fromDate' => '2023-11-07T05:31:56Z',
'toDate' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.loyalty.dog/v2/giftcards/audit-logs/export"
payload := strings.NewReader("{\n \"format\": \"csv\",\n \"merchantId\": \"<string>\",\n \"subjectId\": \"<string>\",\n \"actorId\": \"<string>\",\n \"subjectName\": \"<string>\",\n \"actorName\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"fromDate\": \"2023-11-07T05:31:56Z\",\n \"toDate\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.loyalty.dog/v2/giftcards/audit-logs/export")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"format\": \"csv\",\n \"merchantId\": \"<string>\",\n \"subjectId\": \"<string>\",\n \"actorId\": \"<string>\",\n \"subjectName\": \"<string>\",\n \"actorName\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"fromDate\": \"2023-11-07T05:31:56Z\",\n \"toDate\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loyalty.dog/v2/giftcards/audit-logs/export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"format\": \"csv\",\n \"merchantId\": \"<string>\",\n \"subjectId\": \"<string>\",\n \"actorId\": \"<string>\",\n \"subjectName\": \"<string>\",\n \"actorName\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"fromDate\": \"2023-11-07T05:31:56Z\",\n \"toDate\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"taskId": "<string>",
"status": "<string>",
"downloadUrl": "<string>",
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
JWT access token obtained from POST /v2/token.
Headers
Body
application/json
⌘I
