Trying to get inbound text responses in GoHighLevel - twilio

I have Twilio integrated with GoHighlevel. I am trying to get inbound SMS responses to appear in the GHL contact. Outbound messages are functioning and logging correctly, but not inbound. Can anyone assist?

Twilio developer evangelist here.
I've not used GoHighLevel, so this is a bit of a stab in the dark.
Incoming messages to a Twilio number trigger a webhook (an HTTP request) to an application to notify the application. If the webhooks aren't set up correctly, then those messages won't make it to the other application (though they are all stored within Twilio).
I would recommend you log in to your Twilio account and check the settings for your numbers. You want to ensure that your numbers have a GoHighLevel URL setup for incoming messages.
In one of the GoHighLevel support topic videos for Twilio I spotted what the webhook URL should probably look like.
https://api.gohighlevel.com/twilio/incoming_message
Check your numbers, make sure they have something like that. And if it is still not working then I would contact GoHighLevel support to find out what the correct settings should be.

Related

Twilio not sending webhooks in Progammable Chat

I would like to ask a question or maybe report a bug after solving my doubts. I started working with Programmable Chat and Twilio do not want to send a webhook to specific url but only when I'm sending message from my PHP code. I downloaded example node app and sending message from that, everything is working really nice, I'm getting post request from Twilio but if only I will send message from PHP, nothing at all. And strange is, after sending message from PHP, it will appear immediately in chat which means that it's working.
How does it possible? Could it mean that Twilio on theirs backend has an a bug when they receive message from PHP and becuase of that they are not fire webhook event?
I eliminated all differences, everything is that same beside that one message is sending from PHP and another from node. Same situation from API Explorer.
Gif presentation
Twilio developer evangelist here.
When you send messages to Programmable Chat from the REST API then webhooks aren't triggered. I think the reasoning is because you are making the call from your server, then your server is already aware that you are sending a message and you don't need to receive a webhook to do so. It also saves from the potential of infinite loops (if your webhook sends a message via the REST API, the requests would just go in circles).
So, it's not a bug, but a design choice. If you need to trigger your webhooks when you send a message from the REST API, you will need to make the webhook from your own server.

How to receive contact name via Twilio WhatsApp

I am using the Twilio API for WhatsApp in a sandbox, for prototyping and testing. According to the Facebook / WhatsApp documentation, there are several types of inbound notifications that may be delivered to your unique Webhook.
Twilio API documentation is very limited and doesn’t mention any of the more advanced scenarios. For example retrieving the customers name, which should be present in every webhook request…
When I inspect the webhook, the body payload is very limited. Is there any way to receive the original channelData?
Apparently, this feature is not implemented yet. I received the following statement from Twilio.
Unfortunately we don't support the Contact name being included in the inbound Whatsapp message posted to your webhook at this time. I've raised a feature request for this with the Product Team in hopes that we'll have this feature available in the near future.
You can get the sender's name using the 'ProfileName' key from the request form.

Twilio Opt-In/Opt-Out API

I am working on an Opt-In /Opt-Out api that integrates with Twilio. The way our Opt-In/Opt-Out works is each company (our customer) signs up for one or more Twilio phone numbers and their customers can opt-in/opt-out into these numbers.
When Twilio receives these opt-in/opt-outs we want Twilio to call us into a webhook URL.
So my question is: how do we register these callback URLs? Do these have to be defined at the time when each company signs up for a phone number? If so whats the API end point for that?
These numbers can be added by different companies at any time. Please advise how to do that. We already have URLs defined for sending and receiving SMS messages with Twilio. In this case we first send the message to Twilio and we specify a callback url in that. Can the Opt-In/Opt-outs work with these already registered end points?
All the phone numbers these companies sing up for are created as a subaccount under us. So is that fine with Twilio and can Twilio call us back on the already registered end points (URLs).
If you have any documentation on how to set up an Opt-In/Opt-Out,please include that. I couldn't find one anywhere. The API method we use for creating subaccounts when companies sign up for a phone number is CreateSubAccount and there is no parameter to specify an call back endpoint URL. I tried contacting their support but they haven't gotten back to us yet.
Twilio developer evangelist here.
I'm not sure exactly what you mean when you say "When Twilio receives these opt-in/opt-outs" as the only thing you will get webhooks for is when a number receives an incoming SMS (or phone call, but we're talking SMS right now).
You can set a different SMS webhook URL per each phone number using the API when you buy the phone number. As part of the POST request to the Incoming Phone Numbers resource you can add the optional parameters SmsUrl and SmsMethod.
Once you have purchased the number, you can also update the webhook URLs for it, by POSTing or PUTing to the instance resource, using the same parameters.
Let me know if this helps at all.

Override Message Service inbound URL programatically

I have setup a trial Twilio account and have been investigating their
Programmable SMS service. Within my account I have also setup a Messaging Service. When I send an SMS I am able to set the URL I wish Twilio to send all delivery events (e.g accepted, sent, delivered etc) to, using a field called statusCallback. However, I am wondering if it is also possible to set the URL for which I wish to receive any replies to the message being sent, as part of the send SMS call? I know I can change the incoming request URL within the Messaging Services area of my Twilio account dashboard, but I would like to be able to set this URL on a per SMS basis, as part of the send SMS API call.
Does anyone know if this is possible? I cannot see anything in the docs to suggest it is but I wanted to know definitively.
I hope the question makes sense but if any clarification is needed then please let me know.
Thanks,
Paul

Does Twilio SMS message log get cleaned up?

Twilio has a nice SMS message log resource that I can query via the REST API. Do developers need to write a garbage collection service to delete old SMS messages? Or is there some retention policy?
Otherwise - will I be charged? (I see MMS storage needs to be deleted manaully)
Twilio evangelist here.
Twilio will only charge you for storing pictures on the Media Instance Resource. Your SMS messages will stay there, and you can query them via the API whenever.
Your messages also stay for as long as you own the number.

Resources