Skip to content

Edit the awarded achievement of a user

PATCH
/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 PATCH \
'http://localhost/api/achievements/{achievementId}/users/{userId}' \
 --data '{
  "validUntil": "string",
  "notice": "string"
}'

Samples

cURL
curl -X PATCH http://localhost/api/achievements/{achievementId}/users/{userId}
JavaScript
fetch("http://localhost/api/achievements/{achievementId}/users/{userId}", { method: "PATCH" })
  .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, "PATCH");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python
import requests
response = requests.patch("http://localhost/api/achievements/{achievementId}/users/{userId}")
print(response.json())