L’API On-Premises ne sera bientôt plus disponible. Consultez notre document Abandon progressif de l’API On-Premises pour de plus amples détails, mais aussi pour connaître la procédure de migration vers notre API Cloud nouvelle génération.
/v1/settings/profile/photo
Use this endpoint to manage your profile photo.
You must use the admin account to access the profile settings.
The WhatsApp Business API client scales and crops uploaded profile photos to be a square with a max edge of 640px and max size of 5MB before uploading to our servers. Images with a height or width of less than 192px may cause issues when the resizing occurs, because of this, an image size of 640x640 is recommended.
You can retrieve an existing profile photo in the following ways:
/v1/settings/profile/photo
endpoint to retrieve the image that you are using as your profile photo as either base64-encoded binary content or as a public URL of the image. The image returned will be a thumbnail version of the profile photo.
To get the photo binary, make the following API call:
GET /v1/settings/profile/photo
A successful response contains the base64-encoded binary of the profile photo.
Content-Type: mage/jpeg, or other appropriate type Content-Length: content-size
binary-image-content
To get the photo URL, make the following API call:
GET /v1/settings/profile/photo?format=link
A successful response contains the public URL of the profile photo.
{ "settings": { "profile": { "photo": { "link": "profile-photo-url" } } } }
To change your profile photo using the API, send the raw image to the /v1/settings/profile/photo
endpoint.
POST /v1/settings/profile/photo Content-Type: image/jpeg //or other appropriate type
your-binary-image-content
The cURL
should look like:
curl -X POST \ https://your-webapp-hostname:your-webapp-port/v1/settings/profile/photo \ -H 'Authorization: Bearer your-auth-token \ 'Content-Type: image/png' --data-binary @your-path-to-image
A successful request returns the HTTP Status Code 200 OK
and either null
or {}
.
If you encounter any errors, see Error and Status Messages.
Make a DELETE
request to delete your profile photo.
DELETE /v1/settings/profile/photo
A successful request returns the HTTP status code 200 OK
.