ExLine.Api.Content (ExLine v0.1.0)

Copy Markdown View Source

Download media that users sent (image/video/audio/file) and check its status.

These endpoints live on the api-data.line.me host, so requests use the client's :data host. get/2 and preview/2 return the raw binary body; transcoding/2 returns a JSON status map.

Ref: https://developers.line.biz/en/reference/messaging-api/#get-content

Summary

Functions

Downloads the content of a message (image/video/audio/file). Returns the raw bytes.

Downloads a preview image of a message's content.

Gets the transcoding (preparation) status of a message's content.

Functions

get(client, message_id)

@spec get(ExLine.Client.t(), String.t()) ::
  {:ok, binary()} | {:error, ExLine.Error.t()}

Downloads the content of a message (image/video/audio/file). Returns the raw bytes.

Ref: https://developers.line.biz/en/reference/messaging-api/#get-content

preview(client, message_id)

@spec preview(ExLine.Client.t(), String.t()) ::
  {:ok, binary()} | {:error, ExLine.Error.t()}

Downloads a preview image of a message's content.

Ref: https://developers.line.biz/en/reference/messaging-api/#get-image-or-video-preview

transcoding(client, message_id)

@spec transcoding(ExLine.Client.t(), String.t()) ::
  {:ok, map()} | {:error, ExLine.Error.t()}

Gets the transcoding (preparation) status of a message's content.

Ref: https://developers.line.biz/en/reference/messaging-api/#verify-video-or-audio-preparation-status