User
Award XP Reward
Creates an API-type reward for a user, adds the specified XP, and triggers XP processing. If the user doesn’t exist in the campaign and uses a valid web3 address, a new entry will be created. Prevents duplicate rewards with the same ID.
POST
/
user
/
reward
Award XP Reward
curl --request POST \
--url https://prod.claimr.io/api/v1/user/reward \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account": "<string>",
"platform": "<string>",
"pid": "<string>",
"id": "<string>",
"xp": 1,
"kind": "<string>"
}
'import requests
url = "https://prod.claimr.io/api/v1/user/reward"
payload = {
"account": "<string>",
"platform": "<string>",
"pid": "<string>",
"id": "<string>",
"xp": 1,
"kind": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
account: '<string>',
platform: '<string>',
pid: '<string>',
id: '<string>',
xp: 1,
kind: '<string>'
})
};
fetch('https://prod.claimr.io/api/v1/user/reward', 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://prod.claimr.io/api/v1/user/reward",
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([
'account' => '<string>',
'platform' => '<string>',
'pid' => '<string>',
'id' => '<string>',
'xp' => 1,
'kind' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://prod.claimr.io/api/v1/user/reward"
payload := strings.NewReader("{\n \"account\": \"<string>\",\n \"platform\": \"<string>\",\n \"pid\": \"<string>\",\n \"id\": \"<string>\",\n \"xp\": 1,\n \"kind\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://prod.claimr.io/api/v1/user/reward")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account\": \"<string>\",\n \"platform\": \"<string>\",\n \"pid\": \"<string>\",\n \"id\": \"<string>\",\n \"xp\": 1,\n \"kind\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod.claimr.io/api/v1/user/reward")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account\": \"<string>\",\n \"platform\": \"<string>\",\n \"pid\": \"<string>\",\n \"id\": \"<string>\",\n \"xp\": 1,\n \"kind\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": true,
"error": {
"code": 400,
"message": "bad request"
}
}{
"success": true,
"error": {
"code": 401,
"message": "unauthorized"
}
}{
"success": true,
"error": {
"code": 403,
"message": "access denied"
}
}{
"success": true,
"error": {
"code": 500,
"message": "internal error"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Account identifier of the user
Platform where the account exists (e.g., 'web3', 'claimr')
Campaign ID
Unique reward identifier (prevents duplicate rewards)
Amount of XP to award to the user
Required range:
x >= 0Reward kind
Response
Reward successfully awarded and XP processed.
Example:
true
⌘I
Award XP Reward
curl --request POST \
--url https://prod.claimr.io/api/v1/user/reward \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account": "<string>",
"platform": "<string>",
"pid": "<string>",
"id": "<string>",
"xp": 1,
"kind": "<string>"
}
'import requests
url = "https://prod.claimr.io/api/v1/user/reward"
payload = {
"account": "<string>",
"platform": "<string>",
"pid": "<string>",
"id": "<string>",
"xp": 1,
"kind": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
account: '<string>',
platform: '<string>',
pid: '<string>',
id: '<string>',
xp: 1,
kind: '<string>'
})
};
fetch('https://prod.claimr.io/api/v1/user/reward', 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://prod.claimr.io/api/v1/user/reward",
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([
'account' => '<string>',
'platform' => '<string>',
'pid' => '<string>',
'id' => '<string>',
'xp' => 1,
'kind' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://prod.claimr.io/api/v1/user/reward"
payload := strings.NewReader("{\n \"account\": \"<string>\",\n \"platform\": \"<string>\",\n \"pid\": \"<string>\",\n \"id\": \"<string>\",\n \"xp\": 1,\n \"kind\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://prod.claimr.io/api/v1/user/reward")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account\": \"<string>\",\n \"platform\": \"<string>\",\n \"pid\": \"<string>\",\n \"id\": \"<string>\",\n \"xp\": 1,\n \"kind\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod.claimr.io/api/v1/user/reward")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account\": \"<string>\",\n \"platform\": \"<string>\",\n \"pid\": \"<string>\",\n \"id\": \"<string>\",\n \"xp\": 1,\n \"kind\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": true,
"error": {
"code": 400,
"message": "bad request"
}
}{
"success": true,
"error": {
"code": 401,
"message": "unauthorized"
}
}{
"success": true,
"error": {
"code": 403,
"message": "access denied"
}
}{
"success": true,
"error": {
"code": 500,
"message": "internal error"
}
}