People

Avatars and covers

identity-image-service

The picture that stands for a profile, and the wide picture across the top of a profile or a post.

Set the avatar of a profile

POST/avatars/{node_id}/

Replaces any there was, which is removed from storage. Answers with each size of the new one, at addresses good for a short while.

Who: Somebody signed in

Parameters

  • node_idintegerrequiredin path
    The id of the profile.

Body multipart/form-data

  • avatarfilerequired
    The picture: a JPEG or a PNG, of at most 10 MB.

Answers

  • 201
    Created
    map of Image application/json
  • 400
    file_required when no file was sent, file_unreadable when it cannot be read as a picture
    Refusal application/json
  • 401
    no token, or one that has expired
  • 403
    it cannot have one, or the viewer may not change it
  • 404
    there is no such profile or post, or the viewer may not see it
  • 413
    file_too_large: more than 10 MB, or too many pixels
    Refusal application/json
  • 415
    file_unsupported: not a JPEG or a PNG
    Refusal application/json

Request

curl -X POST "https://api.example.org/avatars/<node_id>/" \
  -H "Authorization: Bearer $TOKEN" \
  -F "avatar=@photo.jpg"

Answer · 201

{
  "key": {
    "size": {
      "height": 1,
      "width": 1
    },
    "url": "https://example.org/"
  }
}

Remove the avatar of a profile

DELETE/avatars/{node_id}/

Who: Somebody signed in

Parameters

  • node_idintegerrequiredin path
    The id of the profile or the post.

Answers

  • 200
    it has none now, whether or not it had one
  • 400
    the request is not well formed, or a value in it is not one it may be
  • 401
    no token, or one that has expired
  • 403
    it cannot have one, or the viewer may not change it
  • 404
    there is no such profile or post, or the viewer may not see it

Request

curl -X DELETE "https://api.example.org/avatars/<node_id>/" \
  -H "Authorization: Bearer $TOKEN"

A public profile's avatar, at an address that does not change

GET/avatars/{uuid}/{size}

For other servers, which keep the address of a picture for weeks: a redirect to a freshly signed address in storage. Only what anybody may see is answered for; anything else, on a site for members included, is not found, in the same words as what does not exist.

Who: Anyone, signed in or not

Parameters

  • uuidstringrequiredin path
    The node's UUID, which other servers are given.
  • sizestringrequiredin path
    Which size: for an avatar small, medium, large or square; for a cover medium or large.

Answers

  • 302
    the picture is at the address in Location
  • 404
    there is no such picture that anybody may see

Request

curl "https://api.example.org/avatars/<uuid>/<size>"

Set the cover of a profile or a post

POST/covers/{node_id}/

Replaces any there was, which is removed from storage. Answers with each size of the new one, at addresses good for a short while.

Who: Somebody signed in

Parameters

  • node_idintegerrequiredin path
    The id of the profile or the post.

Body multipart/form-data

  • coverfilerequired
    The picture: a JPEG or a PNG, of at most 10 MB.

Answers

  • 201
    Created
    map of Image application/json
  • 400
    file_required when no file was sent, file_unreadable when it cannot be read as a picture
    Refusal application/json
  • 401
    no token, or one that has expired
  • 403
    it cannot have one, or the viewer may not change it
  • 404
    there is no such profile or post, or the viewer may not see it
  • 413
    file_too_large: more than 10 MB, or too many pixels
    Refusal application/json
  • 415
    file_unsupported: not a JPEG or a PNG
    Refusal application/json

Request

curl -X POST "https://api.example.org/covers/<node_id>/" \
  -H "Authorization: Bearer $TOKEN" \
  -F "cover=@photo.jpg"

Answer · 201

{
  "key": {
    "size": {
      "height": 1,
      "width": 1
    },
    "url": "https://example.org/"
  }
}

Remove the cover of a profile or a post

DELETE/covers/{node_id}/

Who: Somebody signed in

Parameters

  • node_idintegerrequiredin path
    The id of the profile or the post.

Answers

  • 200
    it has none now, whether or not it had one
  • 400
    the request is not well formed, or a value in it is not one it may be
  • 401
    no token, or one that has expired
  • 403
    it cannot have one, or the viewer may not change it
  • 404
    there is no such profile or post, or the viewer may not see it

Request

curl -X DELETE "https://api.example.org/covers/<node_id>/" \
  -H "Authorization: Bearer $TOKEN"

A public profile's or post's cover, at an address that does not change

GET/covers/{uuid}/{size}

For other servers, which keep the address of a picture for weeks: a redirect to a freshly signed address in storage. Only what anybody may see is answered for; anything else, on a site for members included, is not found, in the same words as what does not exist.

Who: Anyone, signed in or not

Parameters

  • uuidstringrequiredin path
    The node's UUID, which other servers are given.
  • sizestringrequiredin path
    Which size: for an avatar small, medium, large or square; for a cover medium or large.

Answers

  • 302
    the picture is at the address in Location
  • 404
    there is no such picture that anybody may see

Request

curl "https://api.example.org/covers/<uuid>/<size>"

Written by Claude, reviewed by Rastin Mehr · About this