Skip to content

Award an achievement to a user

POST
/api/achievements/{achievementId}/users/{userId}

Authorizations

api_key
Type: API Key (header: X-CSRF-Token)

Parameters

Path Parameters

achievementId*
Typestring
Required
userId*
Typestring
Required

Request Body

JSON
{
"validUntil": "string",
"notice": "string"
}

Responses

Success
JSON
{
"user": {
"id": 0,
"name": "string",
"avatar": "string",
"isSleeping": true
},
"reviewer": {
"id": 0,
"name": "string",
"avatar": "string",
"isSleeping": true
},
"achievementId": 0,
"notice": "string",
"validUntil": "string",
"createdAt": "string"
}
Authorization
api_key
Variables
Key
Value
achievementId*
userId*
cURL
curl -X POST \
'http://localhost/api/achievements/{achievementId}/users/{userId}' \
 --data '{
  "validUntil": "string",
  "notice": "string"
}'

Samples

cURL
curl -X POST http://localhost/api/achievements/{achievementId}/users/{userId}
JavaScript
fetch("http://localhost/api/achievements/{achievementId}/users/{userId}", { method: "POST" })
  .then(response => response.json())
  .then(data => console.log(data));
PHP
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://localhost/api/achievements/{achievementId}/users/{userId}");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python
import requests
response = requests.post("http://localhost/api/achievements/{achievementId}/users/{userId}")
print(response.json())