Call a webhook Api Whatsapp

I'm experiencing an issue when trying to send messages through the WhatsApp API using AppSheet. I've configured a task to send messages through the WhatsApp API, but the task fails with a "400 Bad Request" status code. Below, I provide details about the request and the response received:

Request Details:

Received Response:

  • Status Code: 400 Bad Request
  • Error Message: "The remote server returned an error: (400) Bad Request."

Observations:

  • The task to send messages through the WhatsApp API utilizes AppSheet.
  • The access token used in the authorization header is valid.
  • It has been verified that the destination URL and the request payload are correct and in the expected format.
  • Most importantly, the task only works when using one variable in the payload. It fails when attempting to use more than two variables.

I would appreciate any guidance or assistance in resolving this issue and ensuring that the task of sending messages works correctly through the WhatsApp API using AppSheet.

Thank you for your help!

Request Payload (Working):
{
"messaging_product": "whatsapp",
"to": "51964221743",
"type": "template",
"template": {
"name": "orden2",
"language": {
"code": "es"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "<<[CLIENTE]>>"
}
]
}
]
}
}
Request Payload (Not Working):

{
"messaging_product": "whatsapp",
"to": "51964221743",
"type": "template",
"template": {
"name": "orden2",
"language": {
"code": "es"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "<<[CLIENTE]>>"
},
{
"type": "text",
"text": "<<[BANCOS]>>"
},
{
"type": "text",
"text": "<<[BANCOS CARGO]>>"
},
{
"type": "text",
"text": "<<[No de Documento]>>"
},
{
"type": "text",
"text": "<<[PKID]>>"
},
{
"type": "text",
"text": "<<[FECHA]>>"
},
{
"type": "text",
"text": "<<[HORA]>>"
},
{
"type": "text",
"text": "<<[Tipo de Operacion]>>"
},
{
"type": "text",
"text": "<<[Monto USD]>>"
},
{
"type": "text",
"text": "<<[FX COTIZAR]>>"
},
{
"type": "text",
"text": "<<[Monto PEN]>>"
},
{
"type": "text",
"text": "<<[BANCOS DESTINO]>>"
},
{
"type": "text",
"text": "<<[BANCOS ABONO]>>"
},
{
"type": "text",
"text": "<<[CUENTA ABONO VALOR]>>"
}
]
}
]
}
}




 

0 8 316
8 REPLIES 8

You may want to try 

{
"messaging_product": "whatsapp",
"to": "51964221743",
"type": "template",
"template": {
"name": "orden2",
"language": {
"code": "es"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "<<CONCATENATE([CLIENTE], "  ",[BANCOS]," ", [BANCOS CARGO]," ", [No de Documento]," ",[PKID])>>"
}
]
}
]
}
}

 

If the above works, you could suitably format the Concatenated string by including other columns in the expression and some headings for columns etc.

Thanks. Let me try

 

I have similar problem with tele gram. First try to send a simple text for check, because text not sends with symbols like -, (), _ etc.

To just text it works perfectly. It even works well with just one variable. The issue arises when I use more than one.

Maybe [VARS] contains symbols like -, () etc. It needs replace to "\-".

It should solve the problem: SUBSTITUTE([VARS], "-", "\-")


@Eschiantarelli wrote:

Thanks. Let me try


 

were you able to try concatenation?

Hello, after going around in circles, I've arrived at this solution. Create a virtual column of type long text and include all the columns and texts I want to go in the message in the formula. This way, I can call the message by just indicating to send this new column, which in turn has several columns inside it.

To send an image or document, I've only been able to do it with the service provider https://textmebot.com/, which has an annual payment plan of $60, where it's easy to set up the sending with your own phone number. https://api.textmebot.com/send.php?recipient=[phone number]& apikey=[your apikey]& document=[url of pdf file]

Top Labels in this Space