![]() Make sure to click Show Password to ensure that you have entered your auth token variable correctly. Since we have already defined these variables in our environment, you can reference them as for their respective fields as seen in the following screenshot. Per Twilio’s documentation, use the ACCOUNT_SID for our username and AUTH_TOKEN for our password. Twilio supports Basic Auth, which uses username and password schemes. To begin, click on the Collections tab on the left panel and click New Collection.įor the purpose of this article, we will name our collection “Twilio Messages.” Feel free to add a description! For this article, I added “A collection of requests to send to Twilio’s Messaging API.” to the description.Ĭlick on the Authorization tab since our request needs to be authenticated in order to send it to Twilio. It is time to create a collection! Similar to the concept of environment, a Postman collection is a group of related requests. In my case, my environment is called “Twilio Credentials.” Once you close out the new Environment window, you are now able to select your newly created environment in the dropdown in the top right corner. Once you are finished, click the Add button. Thank you environment variables for helping secure our data! Now, you can reference these variables in Postman without typing out their values every time. Note that you will need to use E.164 format for phone numbers. ![]() For our purposes, we will need your Twilio ACCOUNT_SID, AUTH_TOKEN, TWILIO_PHONE_NUMBER, which you can find by logging on to your Twilio Console.Īdd a verified, non-Twilio phone number as MY_PHONE_NUMBER to send your text to as well. Variables may include URLs, API keys, passwords, etc. Add a Name, (I named my Environment “Twilio Credentials”) in addition to any necessary variables and their values. In the top left corner of the Postman window, click New and select “Environment” as seen in the screenshots below:Ī popup should appear. This environment is simply a group of related variables you can use when making calls. Feel free to click the Skip button at the bottom of the screen.Ĭreate an environment on Postman to send the requests in. If you just downloaded Postman, you will be asked to create an account when you first open the application. ![]() The use of Postman in this article will replace the code below: Without Postman, we would have to use command line tools, like curl, to do so. This amazing tool offers a variety of features to help aid in API development.Īs an intern at Twilio, I have used Postman in my day-to-day work to send and test my endpoints. Postman is a free, easy-to-use development tool that replaces sending calls through the terminal. You can review the features and limitations of a free Twilio account. ![]() If you are new to Twilio create a free account now. To complete this tutorial, you will need the following. We are going to POST to Twilio’s messaging API to send a text message from my Twilio phone number to my personal phone number. ![]() In this post, I am going to demonstrate how to use Postman to make and send a request as well as test any API endpoint. Thus, knowing a nifty API development tool such as Postman can make your life much easier! Perhaps you’re developing your own API and need to test it along the way. Learning how to use a 3rd party API can be difficult especially when you need to visually see the calls you’re making. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |