Rotate the signing secret
curl --request POST \
--url https://api.rigaly.com/api/v1/rewards/{id}/webhook/rotate-secret \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.rigaly.com/api/v1/rewards/{id}/webhook/rotate-secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.rigaly.com/api/v1/rewards/{id}/webhook/rotate-secret"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rigaly.com/api/v1/rewards/{id}/webhook/rotate-secret",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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;
}{
"success": true,
"message": "Signing secret rotated. Store it now — it is never shown again.",
"data": {
"digital_webhook_secret": "8c1f0a94d3e27b65f4a1c0d9e8b7a6f5c4d3e2b1a09f8e7d6c5b4a3928170615"
}
}{
"success": false,
"error": {
"message": "REWARD_NOT_EXTERNALLY_SOURCED"
}
}{
"success": false,
"error": {
"message": "Reward not found"
}
}Rewards
Rotate the signing secret
Issues a new signing secret for an external reward and returns it once — it is never shown again by any endpoint. The previous secret stops working immediately, so deploy the new one to your endpoint promptly: calls signed with a secret your endpoint no longer accepts will fail verification, and those redemptions are cancelled without charging the customer.
POST
/
api
/
v1
/
rewards
/
{id}
/
webhook
/
rotate-secret
Rotate the signing secret
curl --request POST \
--url https://api.rigaly.com/api/v1/rewards/{id}/webhook/rotate-secret \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.rigaly.com/api/v1/rewards/{id}/webhook/rotate-secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.rigaly.com/api/v1/rewards/{id}/webhook/rotate-secret"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rigaly.com/api/v1/rewards/{id}/webhook/rotate-secret",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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;
}{
"success": true,
"message": "Signing secret rotated. Store it now — it is never shown again.",
"data": {
"digital_webhook_secret": "8c1f0a94d3e27b65f4a1c0d9e8b7a6f5c4d3e2b1a09f8e7d6c5b4a3928170615"
}
}{
"success": false,
"error": {
"message": "REWARD_NOT_EXTERNALLY_SOURCED"
}
}{
"success": false,
"error": {
"message": "Reward not found"
}
}