Posts tagged with pdf

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"        }    } }```

I am trying to send a pdf through WhatsApp Business API that is stored in google drive, but I am receiving an error " 12300 - Invalid Content-Type " can you help me where am I going wrong also, I want to know how to send a pdf in MediaUrl from my local storage. I tried using Twilio Assets but it's also not working. Here is my code:

 static void Main(string[] args) {     var accountSid = " ";     var authToken = " ";     TwilioClient.Init(accountSid, authToken);     ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;     var mediaUrl = new[] {         new Uri("google drive link")     }.ToList();          var messageOptions = new CreateMessageOptions(         new PhoneNumber("whatsapp:+91XXXXXX"));     messageOptions.From = new PhoneNumber("whatsapp:+XXXXXXXX");     messageOptions.Body = "Hello how are you?";     messageOptions.MediaUrl = mediaUrl;     var message = MessageResource.Create(messageOptions);     Console.WriteLine(message.Body);     Console.ReadLine(); }