<image> tag, HTML <img> tag, or mini-program wx.previewImage interface, and so on. This interface will automatically 302 redirect to the actual image URL; the same applies to videos and files.GET /api/v1/file/{LibraryId}/{SpaceId}/{FilePath}?history_id={HistoryId}&access_token={AccessToken}&user_id={UserId}
Request parameters. | Description | Type | Required or Not |
LibraryId | Media Library ID, obtained after creating a media library in the media hosting console. See Create Media Library | String | Yes |
SpaceId | Space ID. If the media library is in single-tenant mode, this parameter is fixed as hyphen (`-`); if the media library is in multi-tenant mode, you must specify this parameter. See Create Tenant Space | String | No |
FilePath | complete file path, such as foo/bar/file.docx | String | Yes |
HistoryId | Version ID, which is used to obtain file content of different versions. If not specified, it defaults to the latest version. To retrieve, see View historical version list. | String | No |
AccessToken | Access token, see Generate access token | String | Yes |
UserId | User identity recognition. When the access token corresponds to administrator permissions and the user identity recognition during token application is empty, it is used to temporarily specify user identity. For details, see Generate Access Token API. | String | No |
Response Parameters | Description | Type |
Location | Includes URLs for files that can be directly shown or downloaded | String |
x-smh-type | media library type | String |
x-smh-creation-time | The time when file upload completes | String |
x-smh-content-type | File type | String |
x-smh-size | File size. | String |
x-smh-etag | File etag | String |
x-smh-crc64 | File CRC64-ECMA182 check value, to avoid precision issues, here in string format | String |
x-smh-meta-* | custom metadata | String |
Feedback