Callback Profile for WhatsApp Resumable Media Status Update
You can configure the Callback Profile for WhatsApp Resumable Media Status Update, if you want to receive notifications regarding the changes in resumable media status. You need to first create a Callback Profile and then add the Callback Profile ID associated to this newly created Callback Profile to your WABA.
Creating a Callback Profile for WhatsApp Resumable Media Status Update
To create a Callback Profile for WhatsApp Resumable Media Status Update:
-
Follow the instructions given in Callback Profiles.
-
Select the required HTTP method:
i. GET and in the Endpoint field, enter the endpoint and the query parameters as shown in the following example:https://<your-callback-endpoint>?status="<status>"&uploaded_file_handle="<uploaded_file_handle>"&file_name="<file_name>"&file_link="<file_link>"&resumable_media_id="<resumable_media_id>"&waba_id="<waba_id>"&company_id="<company_id>"&field="<field>"&time="<time>"&callback_profile_id="<callback_profile_id>"
Notes:- You need to add your endpoint where you want to receive notifications (the one here is just an example).
- You must add all the query parameters to get the information about the incoming message.
ii Use the POST method and the following details:
a. In the Endpoint field, enter the endpoint (as shown in the following example) where you want to receive notifications, as shown:
https://<your-callback-endpoint>
b. Enter the following body in the Dynamic Variables text area:
{
"status": "<status>",
"uploaded_file_handle": "<uploaded_file_handle>",
"file_name": "<file_name>",
"file_link":"<file_link>",
"resumable_media_id": "<resumable_media_id>",
"waba_id": "<waba_id>",
"company_id": "<company_id>",
"field": "<field>",
"time": "<time>",
"callback_profile_id": "<callback_profile_id>"
}
Sample Response
The following is an example of a callback received due to WhatsApp resumable media status:
Sample UPLOADED status callback
{
"company_id": "Ze15c65XXXX",
"field": "resumable_media_status_update",
"file_name": "test.jpg",
"file_link":"https://whatsapp.amxxxaws.com/Zexxxx22f/173xxx416_f1xxxxf7-3xxf-4xx5-axx2-b3xxxxxxxx7btest.jpg",
"resumable_media_id": "85",
"status": "UPLOADED",
"uploaded_file_handle": "4:cGF2xxxxxxBn:aWxxxxxxanBn:Axxxxxx93E5LsDBKsE_JixxxbQu-eyxxxxxxwOeKeTUf8kc-ZSEixxxxxx2OlAxfeYXow_aKKel",
"waba_id": "3476339784XXXXX",
"callback_profile_id": "stage_c46xxxx7-1ab6-4f35-9a7b-9xxxxxxxxb19",
"time": "1738919890"
}
Sample FAILED status callback
{
"company_id": "Ze15xxxxx22f",
"field": "resumable_media_status_update",
"file_name": "test",
"resumable_media_id": "96",
"status": "FAILED",
"waba_id": "3476xxxxxx41199",
"callback_profile_id": "stage_c466af67-1ab6-4f35-9a7b-9358952c9b19",
"time": "1738919890",
}
Sample EXPIRED status callback
{
"company_id": "Ze1xxxxx22f",
"field": "resumable_media_status_update",
"file_name": "test",
"resumable_media_id": "96",
"status": "EXPIRED",
"uploaded_file_handle": "4:cGFxxxxxxnBn:aW1xxxxxxnBn:ARYxxxxxxE5LsDBKsE:e:17xxxxx795:53xxxxxxxx48003:100xxxxxxxx5884:ARxxxxxxLCL595T9pFg",
"waba_id": "347xxxxxxxx1199",
"callback_profile_id": "stage_c4xxxx67-1xx6-4xx5-9xxb-93xxxxxxb19",
"time": "1738919890",
}
The following table contains the parameters used in the sample response:
Parameter | Description |
---|---|
company_id | A unique identifier for the company associated with the file. This ID is used to reference the specific company in the system. |
field | Link to the uploaded file. |
file_name | The uploaded file name. This field stores the name as it was originally provided by the user or system during the upload process. |
file_link | The MIME type of the uploaded file. This indicates the format of the file, such as "application/pdf" ,"image/jpeg" ,"image/jpg" ,"image/png" , and "video/mp4" . |
resumable_media_id | A unique identifier assigned to the file within the system. This field allows the system to reference the file independently of other attributes like the file name. |
status | The current status of the file upload. This could be any of a predefined set of statuses indicating the state of the file (such as., "UPLOADED" , "PENDING" , or "FAILED" ). |
uploaded_file_handle | A unique handle given by meta when the file is successfully uploaded. |
waba_id | The identifier of the WhatsApp Business Account (WABA) linked to the file. |
callback_profile_id | The Callback Profile ID. |
time | Time when the callback was triggered. |
Updated about 2 months ago