Skip to main content

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:

  1. The API fetches media message details using the given ID.
  2. Media decoding and preparation begin in the background, ensuring uninterrupted API interactions.
  3. 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.
  4. 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

MediaIdResponse

Schema
    mediaId Media IDrequired
Loading...