Skip to main content

Add/Remove Score to a User

This endpoint adds/removes score to a user.

info

This operation requires admin or moderation role.

HTTP Request

POST /api/v2/score/

Parameters

NameInTypeRequiredDescription
userbodyintegertrueA unique integer value identifying the user
scorebodyintegertruePositive or negative integer value
commentbodystringfalseA comment about this operation (only for internal usage)

Example Body Parameters

{
"comment": "string",
"user": "integer",
"score": "integer"
}

Example Request

const inputBody = '{
"user": "integer",
"score": "integer",
"comment": "string"
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/score/',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

Responses

StatusMeaningDescriptionSchema
201CreatedResponse status codeScore

Example responses

{
"id": "integer",
"user": {
"id": "integer",
"username": "string",
"real_name": "string",
"email": "string",
"description": "string",
"avatar": "string",
"reputation": "integer"
},
"score": "string",
"reputation_type": "integer",
"reputation_type_description": "string",
"comment": "string"
}