Skip to main content
PUT
/
api
/
v1
/
profiles
/
{id}
/
avatar
Upload a profile avatar
curl --request PUT \
  --url https://api.scholarlysoftware.com/api/v1/profiles/{id}/avatar \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: image/jpeg' \
  --data '"<string>"'
import requests

url = "https://api.scholarlysoftware.com/api/v1/profiles/{id}/avatar"

payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "image/jpeg"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'image/jpeg'},
body: JSON.stringify('<string>')
};

fetch('https://api.scholarlysoftware.com/api/v1/profiles/{id}/avatar', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
  "message": "<string>",
  "avatar": {
    "attached": true,
    "filename": "avatar.jpg",
    "content_type": "image/jpeg",
    "byte_size": 45000
  }
}
{
"errors": [
{
"status": "<string>",
"title": "<string>",
"detail": "<string>"
}
]
}
{
"errors": [
{
"status": "<string>",
"title": "<string>",
"detail": "<string>"
}
]
}
{
"errors": [
{
"status": "<string>",
"title": "<string>",
"detail": "<string>"
}
]
}
{
"errors": [
{
"status": "<string>",
"title": "<string>",
"detail": "<string>"
}
]
}
{
"errors": [
{
"status": "422",
"title": "Validation Error",
"detail": "Label can't be blank"
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Authorization
string
required

Bearer token

Path Parameters

id
string
required

Body

The body is of type file.

Response

Avatar uploaded

message
string
required
avatar
object
required