Add an Avatar to My Avatars
This endpoint adds an avatar to my avatars
info
This operation requires authentication.
HTTP Request
POST /api/v2/user/avatar/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
avatar | body/formdata | file | true | Avatar of the user |
Example Request
- JavaScript
- Bash
var formdata = new FormData();
formdata.append("avatar", fileInput.files[0], "URL");
var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};
fetch("/api/v2/user/avatar/", requestOptions)
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl --location --request POST '/api/v2/user/avatar/' \
--header 'Authorization: Bearer {access_token}' \
--form 'avatar=@"URL"'
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Response status code | Avatar |
Example responses
- 200
{
"id": "integer",
"primary": "boolean",
"avatar": "string(uri)",
"date_uploaded": "string",
"user": "integer"
}