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
Name | In | Type | Required | Description |
---|---|---|---|---|
user | body | integer | true | A unique integer value identifying the user |
score | body | integer | true | Positive or negative integer value |
comment | body | string | false | A comment about this operation (only for internal usage) |
Example Body Parameters
- JSON
{
"comment": "string",
"user": "integer",
"score": "integer"
}
Example Request
- JavaScript
- Bash
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);
});
# You can also use wget
curl -X POST /api/v2/score/ \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access_token}' \
--data-raw '{
"user": "integer",
"score": "integer",
"comment": "string"
}'
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Response status code | Score |
Example responses
- 200
{
"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"
}