POST
/point-acquire-rule/:id/acquire/Add points
You can add additional points for a user. It's an addition to the automatic rules, e.g. someone received points from a different source and you want to keep them all updated in one place.`
| Attributes | Type | Required | Description |
|---|---|---|---|
| id | integer | yes | A unique identifier for the point acquire rule which is given by User.com |
| user_id | integer | yes | A unique identifier for the user which is given by User.com automatically |
Request
- CURL
- JavaScript
- PHP
- Python
curl --location --request POST 'https://<your_app_subdomain>.user.com/api/public/point-acquire-rule/1/acquire/' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token <your_64_char_api_key>' \
--header 'Accept: */*; version=2' \
--data-raw '{"user_id": "system_user_id"}'
var data = JSON.stringify({
user_id: "system_user_id"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open(
"POST",
"https://<your_app_subdomain>.user.com/api/public/point-acquire-rule/1/acquire/"
);
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Authorization", "Token <your_64_char_api_key>");
xhr.setRequestHeader("Accept", "*/*; version=2");
xhr.send(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<your_app_subdomain>.user.com/api/public/point-acquire-rule/1/acquire/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{ "user_id": "system_user_id" }',
CURLOPT_HTTPHEADER => array(
'accept: application/json',
'Content-Type: application/json',
'Authorization: Token <your_64_char_api_key>',
'Accept: */*; version=2'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
import json
url = "https://<your_app_subdomain>.user.com/api/public/point-acquire-rule/1/acquire/"
payload = json.dumps({
"user_id": "system_user_id"
})
headers = {
'accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Token <your_64_char_api_key>',
'Accept': '*/*; version=2'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)