Testing twilio webhooks in dev environment - twilio

I have a web app in production using Twilio which makes use of the programmable video API and various webhook call backs. When certain events happen, Twilio lets my API know via the webhook so the appropriate actions are then triggered.
From what I can tell, there is no development (ie: sandbox) environment for Twilio. This is very strange. I would expect there to be a sandbox environment so that we can do complete local development without needing to create fake responses from Twilio for webhooks and the likes.
It appears that Twilio's recommendation is to use ngrok or similar for development. But this is not possible when you already have a production application running and Twilio has no sandbox. I can't simply change my webhook endpoint in my Twilio account to point to my local ngrok end point. That would mean that my production end point is not live during that time.
The other suggestion by Twilio is that we create fake responses which we expect to receive by using curl or similar. This seems incredibly impractical having to trigger fake responses at dozens of different points in time throughout the flow of an app rather than simply receiving them from a sandbox/dev environment with Twilio.
What is the recommended method to do local Twilio related development which incorporates webhook callbacks when you already have a production app running?

I'm not familiar with Twillio specifically but generally speaking, you can add multiple webhook URLs. The idea would be to have one URL pointing to your production server and another pointing to the Ngrok endpoint.
Alternatively, you could use https://hookdeck.io (disclaimer: I'm the founder) to send the same webhook to multiple URLs. We call this webhook fan-out, you could set up both your production URL and Ngrok as destinations and provide a single endpoint (provided by Hookdeck) to Twilio.
It would look something like this:

Related

Twilio sandbox for development

We are using an SMS messaging service to send SMS to customers. In order to test and develop the things do we have any Twilio sandbox? We don't want to test all the things directly in PROD Twilio account.
Searched for a solution for the sandbox in Twilio but was not able. As per the article, we saw that there is an option only for WhatsApp only.
The Test Credentials are pretty helpful if you want to test a function and does an API call without actually sending a SMS.

How to programmatically send a message to a Teams BOT

I have a BOT running which reponds to api/messages URL from the BOT Framework Emulator, and I can send text to it.
However what I need to do is write an application which sends text to the BOT over this URL. That is basically does what the BOT Framework Emulator does when I enter text and send it, probably over the graph API.
I am aware of information which demonstrates sending to a chat in a channel, but I just need to send to the BOT itself.
Can anyone advise how I can do this, or is there a suitable sample which demonstrates it.
Thanks
At the end of the day, your bot is really just a web api endpoint. If you set up a tunneling service like ngrok, you can use it's built-in web viewer to see the traffic that is sent to you bot, e.g. via the emulator or even via the azure bot registration page (there is a similar emulator built into the page in Azure). Once you've seen that traffic, you can essentially just mirror it from whatever you want to call from - it's essentially a json payload.
However, considering your bot is just a web api, I'm not sure why you want to "call" your bot from another app. Why not just make another endpoint that you can use for app-to-app communication (like a normal api endpoint). You can then refactor your code so that whatever you need to do can be done either via a bot message OR via the API call.

Telegram Bot load testig

How can I make load testing of Telegram (of FB Messenger) Chatbot? Is there any online/offline tools like load testing in Microsoft Bot Framework?
I know about tools such as Tsung, but how can I use it when chatbot deployed on Heroku?
Tsung is hard, I recommend to use Jmeter since you just need to test your single HTTP API endpoint.
Your bot has a webhook entry point - this is a single HTTP API request. So you just need to push some load into it.
You can try to emulate different HTTP requests with different body data (Telegram messages, statuses, other data.) and then start with 1, 5, 10 requests per second. Jmeter provides all this stuff. And then monitor your Heroku app for errors in logs etc.

Twilio calls integration to ios app without server app

This must be a silly question, but is there any way to make calls btw two iOS apps without server app mentioned in Twilio tutorials. Tell me please what server app does and is there any way to perform such tasks on front end instead?
Twilio developer evangelist here.
The server is required to generate an access token for your users to get access to the Twilio service.
You also need to host some TwiML to tell Twilio what to do with calls when you make them.
If you are not interested in running a server, however, you are in luck. Just recently, Twilio launched Functions, a serverless environment for you to deploy code to. With a Twilio Function, you can use Node.js to generate your access tokens for your users and you won't have to host the code yourself, it will all be on the Twilio platform.
Check out Twilio Functions in your console and take a look at the Node.js quickstart application for the iOS Twilio Programmable Voice SDK which should give you an idea of how to use Node for your application within Functions. I'm sure there'll be tutorials and blog posts coming out. Also, check out this video on how to create access tokens for your apps with Twilio Functions.
Let me know if that helps at all.

What Request URL for Voice in TwiML App setup should I use when I develop on localhost?

I am creating an app in ASP.NET-MVC where I can call phone number from browser.
To do that I need to create capability token like in the sample:
var capability = new TwilioCapability(accountSid, authToken);
capability.AllowClientOutgoing(appSid);
capability.AllowClientIncoming("jenny");
string token = capability.GenerateToken();
The appSid is an identifier of TwimlApp created on my Twilio account as described here: https://www.twilio.com/help/faq/twilio-client/how-do-i-create-a-twiml-app
I have absolutely no idea what should I put in the Request URL in Voice section. I develop on locally on my computer. ASP.NET-MVC app is run on localhost.
Sample image from Twilio's website:
Developing with a web service like Twilio can be difficult when it needs to make requests from a server to your development environment. One of the best tools I've found to make this easy is called ngrok.
ngrok allows you to create tunnels to your machine and give them a friendly name with a custom port.
For example, you could setup ngrok locally on your machine to forward all requests from twilio to yoda.ngrok.com to your environment. This makes it really easy to develop locally with web hooks. Let me know if you have any questions on getting setup!

Resources