Wax.CloudAPI.Media (wax v1.1.4)

Media managment via the Cloud API

Summary

Functions

Downloads a media file from the Whatsapp Cloud server

Uploads a media file to the Cloud API servers from binary data

Uploads a media file to the Cloud API servers from a path

Functions

download(media_id, auth)

@spec download(String.t(), Wax.CloudAPI.Auth.t()) ::
  {:ok, file_binary_data :: binary()} | {:error, String.t()}

Downloads a media file from the Whatsapp Cloud server

upload_binary(binary_file_content, filename, auth)

@spec upload_binary(iodata(), String.t(), Wax.CloudAPI.Auth.t()) ::
  {:ok, Media.media_id()} | {:error, String.t()}

Uploads a media file to the Cloud API servers from binary data

This returns the Media ID, which is required to send any type of media files in a message.

upload_from_path(file_path, auth)

@spec upload_from_path(Path.t(), Wax.CloudAPI.Auth.t()) ::
  {:ok, Media.media_id()} | {:error, String.t()}

Uploads a media file to the Cloud API servers from a path

This returns the Media ID, which is required to send any type of media files in a message.