Upload Media

To upload media, make a POST call to the /media and include the parameters listed below. All media files sent through this endpoint are encrypted and persist for 30 days, unless they are deleted earlier.

Parameters

This is the main parameter used in upload media requests:

NameDescription

audio

Optional

Path to the file stored in your local directory. For example: "/local/path/file.mp3"

required if you have not added parameters to the request

Size Limit: 10MB

Supported options for audio are:

  • audio/aac
  • audio/mp4
  • audio/mpeg
  • audio/amr
  • audio/ogg
  • audio/opus

document

Optional

Path to the file stored in your local directory. For example: "/local/path/file.txt"

required if you have not added parameters to the request

Size Limit: 10MB

Supported options for document are:

  • text/plain
  • application/pdf
  • application/vnd.ms-powerpoint
  • application/msword
  • application/vnd.ms-excel
  • application/vnd.openxmlformats-officedocument.wordprocessingml.document
  • application/vnd.openxmlformats-officedocument.presentationml.presentation
  • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

image

Optional

Path to the file stored in your local directory. For example: "/local/path/file.jpg"

required if you have not added parameters to the request

Size Limit: 5MB

Supported options for images are:

  • image/jpeg
  • image/png

sticker

Optional

Path to the file stored in your local directory. For example: "/local/path/file.webp"

required if you have not added parameters to the request

Size Limit: 100KB

Supported options for sticker are:

  • image/webp

video

Optional

Path to the file stored in your local directory. For example: "/local/path/file.mp4"

required if you have not added parameters to the request

Supported options for video are:

  • video/mp4
  • video/3gp
Size Limit: 10MB

Notes:

  • Only H.264 video codec and AAC audio codec is supported.
  • We support videos with a single audio stream or no audio stream.

Example

Sample request:

curl -X POST 'https://waofficial.botika.online/api/whatsapp/v1/media' \
-H 'Authorization: Bearer {{ API_TOKEN }}' \
-F 'image=@"/path/to/file"'

A successful response includes an object with an identifier for the profile:

{
    "image": {
        "id": "{{ MEDIA_ID }}"
    }
}

You can upload multiple media at once with parameters.

Copyright © 2023 Botika Teknologi Indonesia