Posts tagged with gupshup

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'm testing whatsapp business api image section, it seems like the images available at platform are the ones which are getting displayed and no other images which I pick from s3 bucket or google images.

message = {"type": "image",                                "previewUrl": "https://cdn.shopify.com/s/files/1/0445/8545/1685/products/2_9082b428-a7fa-4648-84b5-b34cc1fea9a1_360x.png",                                "originalUrl": "https://cdn.shopify.com/s/files/1/0445/8545/1685/products/2_9082b428-a7fa-4648-84b5-b34cc1fea9a1_360x.png",                                "caption": "some caption",                                "filename": "Sample.jpeg"} 

headers = { 'Cache-Control': 'no-cache', 'Content-Type': 'application/x-www-form-urlencoded', 'apikey': 'mykey', 'cache-control': 'no-cache', }

the above used url doesn't seem to be displayed in chat whereas https://www.buildquickbots.com/whatsapp/media/sample/png/sample01.png comes fine