GET/ point-exchange-rule/ ?page={page_number}
Get point exchange rules
You can return all of your point exchange rules.
Request
- cURL
- JavaScript
- PHP
- Python
curl -X GET "https://<your_app_subdomain>.user.com/api/public/point-exchange-rule/?page={page_number}" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2"
const response = await fetch(
"https://<your_app_subdomain>.user.com/api/public/point-exchange-rule/?page={page_number}",
{
method: "GET",
headers: {
Authorization: "Token <your_64_char_api_key>",
Accept: "*/*; version=2",
},
},
);
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/public/point-exchange-rule/?page={page_number}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Token <your_64_char_api_key>",
"Accept: */*; version=2",
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
response = requests.get(
"https://<your_app_subdomain>.user.com/api/public/point-exchange-rule/?page={page_number}",
headers={
"Authorization": "Token <your_64_char_api_key>",
"Accept": "*/*; version=2",
},
)
print(response.json())
Response examples
- 200 OK
{"count": 1,"next": null,"previous": null,"results": [{"id": 6,"name": "10 EUR voucher","amount": 50,"end_date": null,"max_daily_use_count": null,"max_trigger_count_interval": null,"max_trigger_count_value": null,"product_event": null,"point_campaign": 12,"user_attribute": null,"event": null,"level_thresholds": [],"reward": {"type": "10 EUR voucher"}}]}Response fields
Fields returned in the 200 OK response body.
- count
- Number of results across all pages. It can lag behind recent changes; see Response pagination.
- next
- URL of the next page of results. null on the last page.
- previous
- URL of the previous page of results. null on the first page.
- results
- Results on this page.
- results[].
id - ID of the point exchange rule.
- results[].
name - Name of the point exchange rule.
- results[].
amount - Number of points a contact spends to use this rule.
- results[].
end_date - When the rule stops working, ISO 8601;
nullif it doesn't. - results[].
max_daily_use_count - Most times a contact can use this rule per day;
nullfor no limit. - results[].
max_trigger_count_interval - Number of days that
max_trigger_count_valuecounts over;nullmeans over the rule's whole life. - results[].
max_trigger_count_value - Most times a contact can use this rule, within
max_trigger_count_intervaldays if set;nullfor no limit. - results[].
product_event - Product event type that spends the points automatically when the contact triggers it, for example
2(purchase);nullif none. - results[].
point_campaign - ID of the loyalty campaign the rule belongs to.
- results[].
user_attribute name_stdof the contact attribute the points are spent from.- results[].
event - ID of the event that spends the points automatically when the contact triggers it;
nullif none. - results[].
level_thresholds - IDs of the customer levels a contact needs to use this rule; empty for everyone.
- results[].
reward - What the contact gets for the points.
- results[].
reward. type - Reward type:
0amount discount,1percentage off,2free shipping,3free product,4coupon code,5create event or6API.
- results[].
- results[].
note
Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.