GET
/point-acquire-rule/Get point acquisition rules
You can return all of your point acquisition rules.
Request
- CURL
- JavaScript
- PHP
- Python
curl --location --request GET 'https://<your_app_subdomain>.user.com/api/public/point-acquire-rule/' \
--header 'accept: application/json' \
--header 'Accept: */*; version=2' \
--header 'Authorization: Token <your_64_char_api_key>'
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open(
"GET",
"https://<your_app_subdomain>.user.com/api/public/point-acquire-rule/"
);
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "Token <your_64_char_api_key>");
xhr.setRequestHeader("Accept", "*/*; version=2");
xhr.send();
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<your_app_subdomain>.user.com/api/public/point-acquire-rule/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'accept: application/json',
'authorization: Token <your_64_char_api_key>',
'Accept: */*; version=2'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://<your_app_subdomain>.user.com/api/public/point-acquire-rule/"
payload={}
headers = {
'accept': 'application/json',
'authorization': 'Token <your_64_char_api_key>',
'Accept': '*/*; version=2'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
Response
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"name": "rule name",
"product_event": null, // or int number 1-16
"end_date": "2022-05-28T10:00:00Z",
"earning_type": 0,
"earning_value": "10.00",
"max_points_daily": 150,
"max_points_per_transaction": 10,
"max_trigger_count_interval": 10,
"max_trigger_count_value": 10,
"products": {
"product_ids": [],
"segment_ids": [],
"product_category": null
},
"points_expiration_time": "2022-04-29T10:00:00Z",
"event": 9,
"point_campaign": 6,
"user_attribute": "user_attr_name",
"level_thresholds": [
1,
2
]
}
]
}