Skip to main content

Add a Tag

This endpoint adds a tag to a user or to a category or to a contribution.

info

This operation requires an admin role.

note

If the specified object already has this tag associated, the operation is a no-op: nothing changes, and the API still returns 204 No Content (no error).

HTTP Request

POST /api/v2/tag/{id}/add/

Parameters

NameInTypeRequiredDescription
idpathstringtrueA unique integer value identifying this tag
userbodyintegerfalseA unique integer value identifying the user
categorybodyintegerfalseA unique integer value identifying the category
contributionbodyintegerfalseA unique integer value identifying the contribution

One between "user", "category" and "contribution" needs to be passed to this endpoint.

Example Request

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

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

Responses

StatusMeaningDescriptionSchema
204No ContentResponse status codeNone