Description
To obtain the album cover image.
API Description
Cover image retrieval rules: First, find the first media in the corresponding album or tenant space sorted by upload time. If it is an image, use that image. If it is a video, use the first frame of the video. Then, if the {Size} parameter is specified, prioritize intelligent zoom cropping with Face Recognition to {Size}px × {Size}px. If no human face is detected, center and scale crop to {Size}px × {Size}px. If the {Size} parameter is not specified, use the original image. Finally, navigate to the corresponding image URL with a 302 redirect.
You can directly specify this URL in the parameter for using images, such as the mini program <image> tag, HTML <img> tag, or mini program wx.previewImage API. This API will automatically 302 navigate to the actual image URL.
Request
Request Example
GET /api/v1/album/{LibraryId}/{SpaceId}/cover?size={Size}&access_token={AccessToken}&user_id={UserId} or GET /api/v1/album/{LibraryId}/{SpaceId}/cover/{AlbumName}?size={Size}&access_token={AccessToken}&user_id={UserId}
Request Parameters:
LibraryId: Media Library ID, required parameter.
SpaceId: Space ID. If the media library is in single-tenant mode, this parameter is fixed as a hyphen (-). If the media library is in multi-tenant mode, you must specify this parameter.
AlbumName: Album name. This parameter must be specified for album-based media libraries and cannot be specified for non-album media libraries.
AccessToken: Access token. For Public Read Media Library or tenant space, this parameter is not specified. Otherwise, you must specify this parameter.
UserId: User identity recognition. When the permission corresponding to the access token is admin permission and the user identity recognition during access token application is empty, it is used to temporarily specify user identity. For details, see Generate Access Token API. Optional parameter. Request Body
This request has no request body.
Response
Response code
Successful retrieval, back HTTP 200 OK.
Response Body
The response body contains the file content.