Sending template message with Media (our server url) is delivered successfully, In Some times its failed to deliver. "Media upload error" will return.
"errors":[{"code":131053,"title":"Media upload error","message":"Media upload error","error_data":{"details":"Your server hosting media content did not respond back in time. For better performance with links learn more about Media HTTP Caching under the error code section for Media upload error"}}]
Even after we update cache control for the media url, same error display
Any solution for this?

We have a production Meta Application and currently we use the Facebook Login for Business which generates a code that we exchange for a System User Access Token on our microservice. On production we can then use this System User Access Token to make a request to /me/accounts which returns the list of pages that we can access, along with an access token, see below:
{
"data": [
{
"access_token": "",
"id": "",
"tasks": [
"ADVERTISE",
"ANALYZE",
"CREATE_CONTENT",
"MESSAGING",
"MODERATE",
"MANAGE"
]
}
]
}
In production we are then able to take the PAGE_ACCESS_TOKEN from this response and make a request to {page-id}/ads_posts to get the Page Ad Posts for that particular page and all works fine and we get a response as we expect.
However, we also have test applications for our Development and Staging environments. When I perform the same actions, that being: 1. Get System User Access Token by Exchanging Code from Test App Facebook Login For Business 2. Use System User Access Token to make request to /me/accounts 3. Make request to {page-id}/ads_posts using the page access token.
I don't get a proper response from the API, instead I get:
{
"error": {
"message": "Cannot call API for app on behalf of user ",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "AGld_EhayIp285qarsuYVAC"
}
}

  1. I have created the app.
  2. I used the short-lived user access token to get a long-lived user access token.
  3. Then I tried to exchange the long-lived user access token for a long-lived page access token.
  4. This is the response I am getting:
    {      "error": {         "message": "(#15) This method must be called with an app access_token.",         "type": "OAuthException",         "code": 15,         "fbtrace_id": "AaKKgfwJzZsNDXADht1N7wy"      }     } 
  1. This is the endpoint for the API call to receive a long-lived page access token:
https://graph.facebook.com/v19.0/{app-id}/accounts?access_token={long-lived-user-access-token} 
  1. The endpoint for long-lived user access token:
https://graph.facebook.com/v19.0/oauth/access_token?grant_type=fb_exchange_token&client_id={app-id}&client_secret={app-secret}&fb_exchange_token={short-lived-user-access-token} 
  1. According to this documentation, I need to exchange a long-lived user access token in order to get a long-lived pages access token: Facebook Developer Documentation

I'm testing sending media headers through the WhatsApp API. But I keep getting the following error:

{     "error": {         "message": "(#132012) Parameter format does not match format in the created template",         "type": "OAuthException",         "code": 132012,         "error_data": {             "messaging_product": "whatsapp",             "details": "header: Format mismatch, expected VIDEO, received UNKNOWN"         },         "fbtrace_id": "AVPT6EiX3RemyP3uv4S36FZ"     } } 

I'm using a video URL to send the message and confirmed the video is publicly viewable. But I also got the same error when using the video link in the template. I know that there is a Resumable API for uploading the media, but that is not what I'm testing for here.

Any help would be appreciated.

For reference, this is the template:

{             "name": "vid_test",             "previous_category": "UTILITY",             "components": [                 {                     "type": "HEADER",                     "format": "VIDEO",                     "example": {                         "header_handle": [                             "https://scontent.whatsapp.net/v/t61.29466-34/380066992_950204086818012_8956032979900394560_n.mp4?ccb=1-7&_nc_sid=8b1bef&_nc_ohc=pmivIdgTvrAQ7kNvgEgxK28&_nc_oc=Adg2vVNVfN1TlUWzFmJxHpa830uVJRRCSKsooFiDp0E_AQ7gLbB-RIGSlx8UNvM0cXw&_nc_ht=scontent.whatsapp.net&edm=AH51TzQEAAAA&oh=01_Q5AaIFBxPaJzBmN9IaDMHWuIw-w8fQX3uHngw2A_qNyhKBVw&oe=666BB20F"                         ]                     }                 },                 {                     "type": "BODY",                     "text": "tesing {{1}} and use code {{2}} to get amazing discounts on testing videos.",                     "example": {                         "body_text": [                             [                                 "Message content",                                 "MSG25"                             ]                         ]                     }                 },                 {                     "type": "FOOTER",                     "text": "Use the buttons below to manage your marketing subscriptions"                 },                 {                     "type": "BUTTONS",                     "buttons": [                         {                             "type": "QUICK_REPLY",                             "text": "Unsubscribe from Promos"                         },                         {                             "type": "QUICK_REPLY",                             "text": "Unsubscribe from All"                         }                     ]                 }             ],             "language": "en",             "status": "APPROVED",             "category": "MARKETING",             "id": "950180443487043"         } 

And the POST message body:

{   "messaging_product": "whatsapp",   "recipient_type": "individual",   "to": "MY PHONE NUMBER",   "type": "template",   "template": {     "name": "vid_test",     "language": {       "code": "en"     }   },   "components": [     {       "type": "header",       "parameters": [         {           "type": "VIDEO",           "video": {             "Link": "https://static.vecteezy.com/system/resources/previews/006/996/488/mp4/timelapse-full-sunset-free-video.mp4"           }         }       ]     },     {       "Type": "Body",       "parameters": [         {           "type": "text",           "text": "Var 1"         },         {           "type": "text",           "text": "Var 2"         }       ]     }   ] }