User Photo
POST {{_endpoint}}/services/data/v{{version}}/connect/user-profiles/me/photo
Get, post, and crop a user photo. To use an image from the Files page as a user photo, pass the file ID in the fileId property of the request body or in the fileId request parameter. Images uploaded on the User page don’t have a file ID and can’t be used as the fileId.
To upload a binary file as the user photo, you must send it in a multipart/form-data message. For information about how to create the multipart/form-data message, see Uploading Binary Files.
To display user profile photos in a feed, cache the user photos. Then use the photoVersionId property of the Photo response body to determine when you need to update a photo. This technique helps you avoid running over limits and may improve mobile client performance.
Request Body
[{"name"=>"json", "value"=>"{\"cropY\":\"0\",\"cropX\":\"0\",\"cropSize\":\"200\"}", "datatype"=>"string"}, {"name"=>"fileUpload", "value"=>nil, "datatype"=>"null"}]
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Content-Disposition | string | ||
Content-Type | string |
RESPONSES
status: Created
{"fullEmailPhotoUrl":"https://\u003cmy_domain\u003e/img/userprofile/default_profile_200_v2.png?fromEmail=1","largePhotoUrl":"https://\u003cmy_domain\u003e/profilephoto/729.../F","mediumPhotoUrl":"https://\u003cmy_domain\u003e/profilephoto/729.../M","photoVersionId":"729...","smallPhotoUrl":"https://\u003cmy_domain\u003e/profilephoto/729.../T","standardEmailPhotoUrl":"https://\u003cmy_domain\u003e/img/userprofile/default_profile_45_v2.png?fromEmail=1","url":"/services/data/v58.0/connect/user-profiles/005.../photo"}