WhatsApp Media

WhatsApp Media

Upload media for WhatsApp messaging

post
Body
filestring · binaryRequired
Responses
chevron-right
200

Media uploaded successfully

application/json
successbooleanOptionalExample: true
messagestringOptionalExample: Media Uploaded Successfully
post
/api/whatsapp/media/resumable-upload

Upload Media to WhatsApp

post

Uploads media to WhatsApp and saves the file using Spatie Media Library. The response contains the media URL from the Spatie library.

Authorizations
Path parameters
phoneNumberIdintegerRequired

The ID of the WhatsApp phone number for which the media is being uploaded

Body
filestring · binaryOptional

The file to be uploaded

typestringOptional

The media type (e.g., image, video, etc.)

Example: image
Responses
chevron-right
200

Media uploaded successfully

application/json
media_idstringOptionalExample: wamid.HBgMMjAxMTI2MjIwODA2FQIAERgSOTJDREYzMDZBODc1RkY0OTgxAA==
media_urlstringOptionalExample: https://yourdomain.com/uploads/1/whatsapp/1234/sample.jpg
messagestringOptionalExample: Media uploaded successfully
post
/api/whatsapp/media/{phoneNumberId}/upload

Download Media from WhatsApp Cloud API

get

Retrieve and download media content from WhatsApp Cloud API using the provided media ID.

Authorizations
Path parameters
mediaIdstringRequired

The ID of the media to download

Responses
chevron-right
200

Successfully downloaded the media file.

application/octet-stream
string · binaryOptional
get
/whatsapp/media/download/{mediaId}

Upload media to WhatsApp Cloud API

post

Uploads media to WhatsApp Cloud API and returns a media ID.

Authorizations
Path parameters
whatsappPhoneNumberintegerRequired

ID of the WhatsApp phone number

Body
filefileOptional

Media file to upload

typestringOptional

Media type (image, video, etc.)

Example: image
Responses
chevron-right
200

Media uploaded successfully

application/json
media_idstringOptional

WhatsApp media ID

Example: 1166846181421424
messagestringOptionalExample: Media uploaded successfully
post
/api/whatsapp/media/{whatsappPhoneNumber}/upload-cloud

Upload media to OSS

post

Uploads media to OSS and returns the media link.

Authorizations
Path parameters
whatsappPhoneNumberintegerRequired

ID of the WhatsApp phone number

Body
filefileOptional

Media file to upload

typestringOptional

Media type (image, video, etc.)

Example: image
Responses
chevron-right
200

Media uploaded successfully

application/json
media_urlstringOptional

OSS media URL

Example: https://oss.yourdomain.com/uploads/whatsapp/12345/image.jpg
messagestringOptionalExample: Media uploaded successfully
post
/api/whatsapp/media/{whatsappPhoneNumber}/upload-oss

Last updated