โAction Nameโ: โUrgent Team WhatsApp Notificationโ,
โErrorsโ: โError: The webhook url 'https://api.whatsapp.com/send?phone=SELECT(Users[WhatsApp],AND(IN(โ10โ,[GET_URGENT]), CONTAINS([Urgent_Method],{โWhatsAppโ}), [KEY_PRAYER]<>TRUE, IN([_THISROW].[TEAM_NO],[TEAM_NO]))) is not well formed Error: Failed to parse JSON due to Unexpected character encountered while parsing value: h. Path โโ, line 0, position 0โฆโ,
โUrlโ: โhttps://api.whatsapp.com/send?phone=SELECT(Users[WhatsApp],AND(IN(โ10โ,[GET_URGENT]), CONTAINS([Urgent_Method],{โWhatsAppโ}), [KEY_PRAYER]<>TRUE, IN([_THISROW].[TEAM_NO],[TEAM_NO])))โ,
โVerbโ: โPostโ,
I need the select statement to include only the records which fit the criteria.
questions: 1. can whatsapp process a list of numbers like an SMS workflow can?
2. How do I filter to get that list?
Iโm sending the same notification, a link to a specific record in my app, via Email and Text and need to do the same for WhatsApp for international users since Text only works for U.S. and Canada.
Any help will be appreciated.
Maybe enclose the SELECT() expression in <<
and >>
?
Thanks Steve, that got me closer. It passed the phone number on correctly
โActionNotPerformedโ: โ1 errors present.โ,
โActionResultsโ: โCreated 1 ActionResultsโ,
โAction Typeโ: โWebhookโ,
โAction Nameโ: โUrgent Team WhatsApp Notificationโ,
โErrorsโ: โError: Failed to parse JSON due to Unexpected character encountered while parsing value: h. Path โโ, line 0, position 0โฆโ,
โUrlโ: "https://api.whatsapp.com/send?phone=1222333444,
The select appears to be putting a comma after the number, possibly since the result could easily be a list, but I think that is throwing the error.
I think the comma is an artifact of the error report format, not the output of your expression.
The result of a SELECT() expression is always a list, even if a list of just one item. If that comma has to do with the result of the SELECT() expression, it suggests there is more than one phone number, and that the second number is blank. Typically, though, the list of values produced by SELECT() would be separated by space-comma-space (,
) rather than just comma (,
).
Please post a screenshot of the error message, and a screenshot of the template.
Iโm not using a template. Here is the full text of the URL field:
https://api.whatsapp.com/send?phone=<<SELECT(Users[WhatsApp#],AND(IN(โ10โ,[GET_URGENT]), CONTAINS([Urgent_Method],{โWhatsAppโ}), [KEY_PRAYER]<>TRUE, IN([_THISROW].[TEAM_NO],[TEAM_NO])))>>
Try this instead:
https://api.whatsapp.com/send?phone=<<ENCODEURL(SELECT(Users[WhatsApp#],AND(IN(โ10โ,[GET_URGENT]), CONTAINS([Urgent_Method],{โWhatsAppโ}), [KEY_PRAYER]<>TRUE, IN([_THISROW].[TEAM_NO],[TEAM_NO]))))>>
That got me a second phone number but still an error.
Thanks for your help Steve. I appreciate it.
Firstly;
I believe rather than SELECT()
, the expression shall be SUBSTITUTE((ANY(SELECT(...)),"+","")
as phone parameter will only accept numbers. And as HTTP content is chosen as JSON, the payload body shall be:
{
"text": "<<ENCODEURL([MessageColumnName])>>"
}
@Lucinda_Mason
@Steve
The main problem is this:
When you invoke this REST API, it automatically redirects you to a webpage to ensure that you have a WhatsApp account, so that you can send the text via WhatsApp web:
POSTMAN API CALL
JSFIDDLE FOR THE API CALL RESPONSE
CONCLUSION
Provided WhatsApp messaging is a must and you want to send those messages directly from an AppSheet App thru a webhook workflow, I might advise 2 options:
Option#1: Create your own Twilio Account and use their WhatsApp endpoint > https://www.twilio.com/whatsapp
Option#2: Create your own WhatsApp Business Account and then enroll for WhatsApp Business API > https://www.whatsapp.com/business/api/?lang=fb
Thanks Levent.
SO I changed a few things and got it to work, at least NO errors, but nothing opens in my browser and nothing comes through to my whatsapp app on my phone.
In other words, the webhook is running and working but wonโt produce what I want unless I get either a twilio account or whatsapp business? Are those expensive?
here is what shows:
Response": "\n<html lang=โenโ id=โfacebookโ class=โno_jsโ>\n<meta charset=โutf-8โ /><meta name=โreferrerโ content=โdefaultโ id=โmeta_referrerโ /><script nonce=โ14CLNRu1โ>window._cstart=+new Date();<script nonce=โ14CLNRu1โ>function envFlush(a){function b(b){for(var c in a)b[c]=a[c]}window.requireLazy?window.requireLazy([โEnvโ],b):(window.Env=window.Env||{},b(window.Env))}envFlush({โajaxpipe_tokenโ:โAXjfB20W-Rr18g8sEsYโ,โtimeslice_heartbeat_configโ:{โpollIntervalMsโ:33,โidleGapThresholdMsโ:60,โignoredTimesliceNamesโ:{โrequestAnimationFrameโ:true,โEvent listenHandler mousemoveโ:true,"Event listenHandler
โฆ
โActionResultsโ: โCreated 1 ActionResultsโ,
โAction Typeโ: โWebhookโ,
โAction Nameโ: โUrgent Team WhatsApp Notificationโ,
โUrlโ: โhttps://api.whatsapp.com/send?phone=14072324214โ,
โVerbโ: โPostโ,
โMimeTypeโ: โapplication/jsonโ,
โHeadersโ: โโ,
โPayloadโ: "{โtextโ: "https://tinyurl.com/y6rlyhks#appName=Requests-1778436&page=detail&rowc78f692f&table=Pri_Req_Visible_...,
โAppTemplateNameโ: โ922dbed2-5196-4caa-9581-401fc815a472โ,
โOperationโ: โWorkflow actionโ,
โResultโ: โSuccessโ
@Lucinda_Mason
You can review Twilio pricing from here > https://www.twilio.com/whatsapp/pricing/us
User | Count |
---|---|
17 | |
14 | |
10 | |
7 | |
4 |