Syed Zahid
Syed Zahid

Reputation: 21

Gupshup Template Based Attachment

Iam trying to use gupshup whatsapp business api through template.

My template expects a link url for the attachment therefore iam building an url through buffer in nodejs and having given response type for the link url as this.

       statusCode: 200,
       headers: {
           "content-type": "application/pdf",
           'content-disposition': 'inline; filename=suresign.pdf',
           'Accept-Ranges': 'bytes',
           'Content-Length': buffer.length,
       },
       body: buffer.toString('base64'),
       isBase64Encoded: true
   }```


Iam able to generate message id
```{"messageId":"8427c6aa-8140-4d79-a835-ba8f44f6c867","status":"submitted"}```


but in gupshup callback response im getting error as this

```{
   "app": "SureCredsLIVE",
   "timestamp": 1654016941604,
   "version": 2,
   "type": "message-event",
   "payload": {
       "id": "8427c6aa-8140-4d79-a835-ba8f44f6c867",
       "type": "failed",
       "destination": "918553220750",
       "payload": {
           "code": 1011,
           "reason": "Invalid Media Size"
       }
   }
}```

Upvotes: 0

Views: 198

Answers (0)

Related Questions