GET
/point-campaign/?page={page_number}Get point campaigns
You can return all of your point campaigns.
| Attributes | Type | Required | Description |
|---|---|---|---|
| page | integer | no | Page number |
Request
- CURL
- JavaScript
- PHP
- Python
curl --location --request GET 'https://<your_app_subdomain>.user.com/api/public/point-campaign/?page=1' \
--header 'accept: application/json' \
--header 'Authorization: Token <your_64_char_api_key>' \
--header 'Accept: */*; version=2'
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-campaign/?page=1"
);
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-campaign/?page=1',
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-campaign/?page=1"
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": 3,
"next": null,
"previous": null,
"results": [
{
"id": 3,
"name": "string",
"start_date": "2022-03-09T13:18:42.359000Z",
"end_date": "2022-03-09T13:18:42.359000Z",
"created_at": "2022-03-10T13:49:14.064582Z",
"status": 1,
"assigned_events": [0],
"assigned_product_events": [0],
"revenue_goal": 0,
"query_map": {}
},
{
"id": 2,
"name": "string",
"start_date": "2022-03-09T13:18:42.359000Z",
"end_date": "2022-03-09T13:18:42.359000Z",
"created_at": "2022-03-10T13:48:37.245458Z",
"status": 1,
"assigned_events": [0],
"assigned_product_events": [0],
"revenue_goal": 0,
"query_map": {}
},
{
"id": 1,
"name": "string",
"start_date": "2022-03-09T13:18:42.359000Z",
"end_date": "2022-03-09T13:18:42.359000Z",
"created_at": "2022-03-09T13:56:21.520067Z",
"status": 1,
"assigned_events": [0],
"assigned_product_events": [0],
"revenue_goal": 0,
"query_map": {}
}
]
}