4

Announcing the Webhook Plugin: Validate your webhooks with the new webhook plugi...

 2 years ago
source link: https://www.twilio.com/blog/validate-webhooks-with-new-webhook-plugin-for-twilio-cli
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Announcing the Webhook Plugin: Validate your webhooks with the new webhook plugin for the Twilio CLI

Announcing the Webhook Plugin. Validate our webhooks with the new webhook plugin for the Twilio CLI

At Twilio, we heavily use webhooks throughout all of our products, but developing and testing webhooks comes with some challenges. First, you need to make your application running on localhost public, then you have to configure the webhook with your public URL, and then you have to trigger those webhooks by manually texting or calling your Twilio Phone Number. This can be cumbersome and slows down your inner devloop.

To address these challenges, Twilio Labs created the Webhook plugin for the Twilio CLI, to test your webhooks with the following benefits:

  • works with locally and publicly hosted applications,
  • works with Twilio Functions, Twilio Studio, TwiML Bins, and custom developed applications,
  • no need to configure the webhook URL in Twilio,
  • you don't have to text or call to trigger the webhook, so you're not spending time or Twilio credit.

The webhook plugin will emulate Twilio webhook requests and send them to a local or public URL of your choosing. Let's give it a try.

Provision a Twilio webhook application

Before you can test a Twilio application by emulating webhook requests, you’ll need to have one up and running. If you already have an application with a webhook endpoint, or your own custom app that handles webhooks, you can skip this section and use your existing application.

You can find a lot of samples on Twilio CodeExchange, but to deploy Twilio apps in an instant, you can filter them down to samples with "Quick Deploy", like the SMS Auto-response sample.

First, make sure you have a Twilio Account and a Twilio Phone Number. Sign up with Twilio for free and get $20 trial credit. Then, follow these instructions to buy a Twilio Phone Number if you haven't already.

Next, open the SMS Auto-response sample in a new browser tab, select your Twilio Phone Number, and deploy the application. Once the application is deployed, click on the "Go to live application" button. At the bottom of the page, under Troubleshooting, you'll find the webhook URL for this application. Copy and paste this webhook URL somewhere so you can use it later. The URL should look something like https://hello-messaging-1111-xxxxxx.twil.io/hello-messaging.

Congratulations, you now have a Twilio application that will respond with "Hello World" when you text your Twilio Phone Number! 🎉

Install the webhook plugin for the Twilio CLI

First, install the Twilio CLI and log in to your Twilio account if you haven't done so already. Then, in your terminal, run the following command to install the Webhook plugin:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK