Prepare Media for Retrieval
POST/api/v2/instance/:instanceId/media/message/:messageId/prepare
This route is specialized for preparing media for GET requests, allowing asynchronous processing of large media files. This feature is especially useful when dealing with bulky media, such as high-resolution images or long videos, where downloading and decoding can take considerable time.
Execution Flow:
- The API fetches media message details using the given ID.
- Media decoding and preparation begin in the background, ensuring uninterrupted API interactions.
- After the media is decoded, the API issues a webhook to notify that the media is ready for display. The event to be emitted is prepared.media.
- Clients or external systems can then fetch the prepped media using a GET request.
Request
Path Parameters
instanceId stringrequired
ID of the instance.
messageId stringrequired
The ID of the media that will be staged
Responses
- 201
- 400
- 401
MediaIdResponse
- application/json
- Schema
- Example (from schema)
Schema
mediaId Media IDrequired
{
"mediaId": "string"
}
BadRequestException
- application/json
- Schema
- Example (from schema)
Schema
message string[]required
Default value: string,[object Object]
error stringrequired
statusCode numberrequired
{
"message": [
"string"
],
"error": "string",
"statusCode": 0
}
UnauthorizedException
- application/json
- Schema
- Example (from schema)
Schema
message string[]required
Default value: string,[object Object]
error stringrequired
statusCode numberrequired
{
"message": [
"string"
],
"error": "string",
"statusCode": 0
}
Loading...