Skip to main content
POST
/
api
/
loyalty
/
rule_edits
/
{id}
/
restore
Restore Loyalty Rule Edit
curl --request POST \
  --url https://admin.snagsolutions.io/api/loyalty/rule_edits/{id}/restore \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '{}'
import requests

url = "https://admin.snagsolutions.io/api/loyalty/rule_edits/{id}/restore"

payload = {}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};

fetch('https://admin.snagsolutions.io/api/loyalty/rule_edits/{id}/restore', 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://admin.snagsolutions.io/api/loyalty/rule_edits/{id}/restore",
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([

]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);

$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://admin.snagsolutions.io/api/loyalty/rule_edits/{id}/restore"

payload := strings.NewReader("{}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-API-KEY", "<api-key>")
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://admin.snagsolutions.io/api/loyalty/rule_edits/{id}/restore")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://admin.snagsolutions.io/api/loyalty/rule_edits/{id}/restore")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "loyaltyRuleId": "123e4567-e89b-12d3-a456-426614174001",
  "websiteId": "123e4567-e89b-12d3-a456-426614174002",
  "organizationId": "123e4567-e89b-12d3-a456-426614174003",
  "editedByUserId": "123e4567-e89b-12d3-a456-426614174004",
  "editedAt": "2021-08-30T20:00:00Z",
  "action": "create",
  "data": {
    "name": "New Rule Name"
  },
  "previousData": {
    "name": "Old Rule Name"
  },
  "comment": "Updated rule name"
}
"Forbidden, Could not validate api key"

Authorizations

X-API-KEY
string
header
required

Path Parameters

id
string<uuid>
required

Body

application/json

Body

The body is of type object.

Response

200

id
string<uuid>
required

Unique identifier for the rule edit

Example:

"123e4567-e89b-12d3-a456-426614174000"

loyaltyRuleId
string<uuid>
required

ID of the loyalty rule

Example:

"123e4567-e89b-12d3-a456-426614174001"

websiteId
string<uuid>
required

Unique identifier for the website

Example:

"123e4567-e89b-12d3-a456-426614174002"

organizationId
string<uuid>
required

Unique identifier for the organization

Example:

"123e4567-e89b-12d3-a456-426614174003"

editedByUserId
string<uuid>
required

User ID of the user who made the edit

Example:

"123e4567-e89b-12d3-a456-426614174004"

editedAt
string<date-time>
required

Timestamp of when the rule edit was made

Example:

"2021-08-30T20:00:00Z"

action
enum<string>
required

Type of action that was made on the rule

Available options:
create,
update,
delete,
restore
Example:

"create"

data
Data · object
required

Data that was changed on the rule

Example:
{ "name": "New Rule Name" }
previousData
Previous Data · object

Previous data of the rule before the edit

Example:
{ "name": "Old Rule Name" }
comment
string

Comment that was made on the edit

Example:

"Updated rule name"