Skip to main content

createMemberPhotoThumbnails

ThumbnailsDataWrapper createMemberPhotoThumbnails(userId, ThumbnailsRequest)

POST /api/2.0/people/{userId}/photo/thumbnails

Create photo thumbnails

Crops the avatar of a profile to the rectangle given in the request and rebuilds all of its thumbnail sizes, which is the second step of changing an avatar by hand. It works in two modes: with tmpFile it takes the temporary image POST api/2.0/people/{userId}/photo produced with autosave off, makes the cropped result the main photo and then discards the temporary file, and without tmpFile it re-crops the photo the profile already has. A caller may only do this to their own profile - the ID in the route has to be the calling account, and an administrator gets 403 for anybody else - and the account must be allowed to edit its own profile. The call replaces the stored photo, so the previous crop is lost, and it can be repeated with new coordinates as often as needed. Passing width and height as 0 together with tmpFile keeps the whole uploaded image instead of cropping it. The answer holds the URLs of every generated size, the same shape GET api/2.0/people/{userId}/photo returns.

Parameters​

NameInTypeDescriptionNotes
userIdpathStringThe profile whose avatar is cropped, taken from the route. Either the ID of the account or its user name is accepted, and it has to be the calling account, because a profile photo can only be changed by its owner.[required] [example: 00000000-0000-0000-0000-000000000000]
ThumbnailsRequestbodyThumbnailsRequestThe crop rectangle, and optionally the temporary image to crop.[required]

Responses​

Status codeDescriptionTypeResponse headers
200The URLs of the rebuilt photo sizesThumbnailsDataWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
403The ID in the route is not the calling account, the account may not edit its own profile, or x equals the width of the image or y its height--
404No user has the specified ID, or no temporary file has the name given in tmpFile--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
400Bad Request.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

ThumbnailsDataWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json