Announcing the Plivo APIs Postman Collection

Jul 8, 2021
Announcing the Plivo APIs Postman Collection

With Plivo’s SMS platform and voice platform you can add messaging and calling capabilities to your applications with a few lines of code via our server SDKs for PHP, Node.js, Python, .NET, Java, Ruby, and Go. Before you get started, you’d probably like to evaluate our APIs using an HTTP client. You can use any HTTP client you like; many developers choose Postman, a popular HTTP REST client. Postman makes it easy for developers to set up and use to explore API request and response structures.

About Plivo Postman collections

Plivo has released a new Postman collection that includes APIs for our SMS, Voice, Phone Numbers, Account, Lookup, and PHLO products, along with documentation for each API to help you learn about them. You can import these APIs and start using them instantly. The API collection comes with predefined environment variables to help you get started immediately. This post walks you through the process of installing and configuring Postman and our Postman collection and making API requests.

Install Postman and download the Postman collection

First, download and install Postman. You also need a Plivo account; if you don’t have one yet, sign up now. Next, click on the button below.

A window will appear asking if you want the collection to be added to your local Postman app or if you want to use a web app.

You’ll see the collection in your chosen space based on the options you’ve chosen.

Configure environment variables

Now you can add your keys and tokens to your Postman collection. Open Postman from Applications under macOS or your desktop on Windows. The first thing you need to do is add your authentication credentials.

  • Click on the collection Plivo REST API.
Edit Details
  • Select Authorization, then, from the drop-down list, set the Type as Basic Auth.
Set Authorization
  • For Username and Password, fill in your Plivo Auth ID and Auth Token respectively, which you can find on the overview page of the console.

You’ve now authenticated Postman to your Plivo account. The next step is to make that authentication available for every endpoint.

Set up environment variables

Set up the auth_id as an environment variable, so you can use it in every endpoint you have.

  • Click on the collection Plivo REST API.
Edit Details


  • Click on Variables. Declare the variable auth_id, and provide the initial and current value as the Auth ID from the console.
Set Variables
  • Once you’ve done that, you can access your Auth ID by writing within your Postman collection. We’ve already done that for you for all the APIs in the Plivo collection.

Now we’re ready to test some APIs!!

Make an API request to send an SMS

To see how Plivo and Postman work together, let’s start by sending an SMS message. From the imported Plivo REST API collection, select the folder named Messaging, and select the request to Send SMS. Replace src with your from_number, dst with destination number where you’d like to send the message, and text with appropriate content. These are the only mandatory parameters.

You can replace the other optional parameters with meaningful values for your use case, or you can leave them out if you’re not using them in the request.

To learn more about optional and required parameters, either refer to the documentation available within the Postman collection or visit our Messaging API reference guide.

Make an API request to make a phone call

To see how Plivo and Postman work together to making an outbound call. From the imported Plivo REST API collection, select the folder named Call and select the request to make an outbound call. Replace from with your caller_id, to with the destination number you’d like to make a call & answer_url with a valid publicly accessible URL that returns a valid XML. These are the only mandatory parameters.

Note:

  • The answer_url updated in the collection returns a valid XML which means you just need to update the from & to field to test the API.
  • You can replace the other optional parameters with meaningful values for your use case, or you can leave them out if you’re not using them in the request. As the values updated are dummy and can cause errors.
  • To learn more about optional and required parameters, either refer to the documentation available within the Postman collection or visit our Voice API reference guide.

    Make an API request to buy a phone number

    To see how Plivo and Postman work together for searching for an available phone number. From the imported Plivo REST API collection, select the folder named Phone Numbers followed by Search/Buy a Phone Number, and select the request named Buy a Phone Number.

    You can find a number by using the Search Phone numbers API, which is right above the Buy a Phone number API request in your collection, or from the console. Update the URL with the number you wish to purchase — it should look like

    https://api.plivo.com/v1/Account/{{auth_id}}/PhoneNumber/14153234567/

    Under Body, replace app_id with the application you want to attach, if you have one.

    To learn more about optional and required parameters, either refer to the documentation available within the Postman collection or visit our Phone number API reference guide.

    Conclusion

    Postman helps us keep all of our APIs organized, categorized, and always ready to use with just a few modifications depending on our needs. It helps us not only with triggering API requests but also with testing APIs. Overall, Postman makes it easier for developers to test and integrate their systems with Plivo.

    Haven’t tried Plivo yet? Getting started is easy and only takes five minutes. Sign up today.

    Get Volume Pricing

    Thousands of businesses in more than 220 countries trust Plivo’s cloud communications platform

    The best communications platform forthe world’s leading entertainment service

    Frequently asked questions

    No items found.
    footer bg

    Subscribe to Our Newsletter

    Get monthly product and feature updates, the latest industry news, and more!

    Thank you icon
    Thank you!
    Thank you for subscribing
    Oops! Something went wrong while submitting the form.

    POSTS YOU MIGHT LIKE