Webhook to send message via Content Template

30 views Asked by At

I'm struggling to debug this one. I'm trying to send a WhatsApp message with a link to a customer's photo. I've stripped this request all the way back to just a single ContentVariables as text and still can't get it to work.

The template in Twilio I'm using is a simple text template, with the body as follows:

Thank you for your order, please download your video:
{{1}}

I'm sending from Zapier (replaced all the tokens and numbers of course):

Body:

To=whatsapp:+61*********&From=whatsapp:+61*********&ContentSid=HX***********52&ContentVariables={"1":"Test"}

API Response:

{
    "result": {
        "request": {
            "method": "POST",
            "url": "https://api.twilio.com/2010-04-01/Accounts/********/Messages.json",
            "querystring": null,
            "headers": {
                "Content-Type": "application/x-www-form-urlencoded"
            },
            "body": "To=whatsapp:+61******&From=whatsapp:+61*********&ContentSid=HXe******8f52&ContentVariables={\"1\":\"Test\"}",
            "data": null
        },
        "response": {
            "status": 400,
            "headers": {},
            "body": "{\"code\":21619,\"message\":\"A text message body or media urls must be specified.\",\"more_info\":\"https://www.twilio.com/docs/errors/21619\",\"status\":400}",
            "data": {
                "code": 21619,
                "message": "A text message body or media urls must be specified.",
                "more_info": "https://www.twilio.com/docs/errors/21619",
                "status": 400
            }
        }
    }
}

I've gone over everything, tried to get chatgpt to rewrite it, cannot get it going

0

There are 0 answers