Zur Dokumentation springen
API

Ihr Profilfoto setzen

Lädt das Profilfoto der Person hoch und ersetzt ein vorhandenes. Der Body ist das Bild selbst, kein JSON, mit seinem Typ in `Content-Type`: `image/png`, `image/jpeg`, `image/webp` oder `image/gif`, bis zu 5 MB.

PUT/account/photo

Führt den echten Aufruf in Ihrem Workspace aus.

PUT /account/photo

Lädt das Profilfoto der Person hoch und ersetzt ein vorhandenes. Der Body ist das Bild selbst, kein JSON, mit seinem Typ in Content-Type: image/png, image/jpeg, image/webp oder image/gif, bis zu 5 MB.

Beispiel

Erfordert account:write. Das Bild wird in ein Quadrat von 512 Pixeln eingepasst und als WebP gespeichert, und ein animiertes Bild behält sein erstes Einzelbild. Antwortet mit seiner neuen url.

curl
curl -X PUT "$OE/account/photo" -H "$AUTH" -H "Content-Type: image/jpeg" --data-binary @me.jpg
Antwort
{  "object": "account_photo",  "url": "https://cdn-prod.openemail.uk/users/avatars/8c1d4e7a-2f90-4b3c-a6d5-1e7f0b9c2d48.webp"}

Ein Body, der kein Bild eines zulässigen Typs ist, zu groß ist oder sich nicht lesen lässt, ist ein 422 invalid_image. Ein ausgelasteter Bilddienst ist ein 503 image_busy, also versuchen Sie es erneut.

Jeder Upload bekommt eine neue URL, sodass nie ein zwischengespeichertes altes Foto unter dem neuen erscheint.

Referenz