logo
enes

Upload media

Last update: 6 hours ago by Irais Aguirre

Integration summary

  • Base URL: https://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services
  • Token: admin token, in the Authorization: Bearer {{admin-token}} header (how to generate it)
  • Endpoints on this page:
    • POST /v1/template/{{waba_id}}/media-upload: Upload header media

Upload header media

Uploads an image, video, or document to Meta from a public URL and returns its ID. Use this ID in the header_handle field when you create a template with a media header.

Request

Upload header media request:

URLhttps://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/template/{{waba_id}}/media-upload
MethodPOST
Typeapplication/json

Headers

Upload header media headers:

NameDescriptionTypeRequirements
Content-Typeapplication/jsonStringRequired
AuthorizationAdmin token. See Generate authentication token.StringRequired

Parameters

Upload header media parameters:

NameDescriptionTypeRequirements
waba_idWhatsApp Business Account (WABA) ID. It must be the WABA linked to your token.StringRequired

Body

Upload header media body fields:

NameDescriptionTypeRequirements
urlPublic URL of the media file. Supported file types: PDF, JPEG, JPG, PNG, and MP4. Maximum file size: 10 MB.StringRequired

Example

Complete Upload header media example:

curl -X POST "https://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/template/{{waba_id}}/media-upload" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {{admin-token}}' \
-d '{
"url": "https://iili.io/HDQOyc7.jpg"
}'

Response

Upload header media response:

If the file is uploaded successfully, the service responds with HTTP status code 201.

NameDescriptionType
urlURL of the media file you sent.String
idMedia ID. Use it in the header_handle field when you create the template.String

{
"url": "https://iili.io/HDQOyc7.jpg",
"id": "4::aW1hZ2UvanBlZw==:ARZExampleHandle:e:1771350704:1234567890:1234567890:ARZExample"
}


Previous
Get and delete templates
Next
Limitations