Basics - Your First API Call

Go from noob to making an API call


Find the API That Works Best for Your App

The first thing you’ll want to do is locate an API you want to start using. Let’s find an SMS Messaging API for this example. To get started, you can enter ‘SMS Messaging’ in the search bar, which will return the top results for your search term.

alt text

To see the full list of APIs that match your search, press ‘enter’ or click ‘View all search results’.

alt text

From the full search results, you can select the API that best fits your needs by using the information provided such as popularity score, avg. latency, and avg. success rate. There is also a pop-over to preview some of the most popular endpoints of the API and see if the API is Paid, Free, or Freemium. For this example, I’m going to use the Nexmo SMS Messaging API.

Connecting to an API

Once you select your API, the first page you’ll see is the API Endpoints page. This includes most of the information needed to get started. The API endpoints page includes navigation, a list of endpoints, the documentation of the currently selected endpoint, and a code snippet (available in 8 different programming languages) to help you get started with your code.

alt text

Once you reach the API page, the first thing you’ll need to do is see if the API has a pricing page as part of the navigation bar. If it does have pricing, you’ll need to subscribe to an API plan before making a request to the API.

:

You can learn more about the different types of API Pricing and how billing works here.

Subscribing to an API

If the API has pricing associated with it, you’ll need to select a pricing plan before calling the API. Prices are based on a recurring monthly subscription based on the plan selected; plus, overage fees applied when a user exceeds a plan’s quota limits.

alt text

A lot of APIs have a BASIC free plan, which means you can use that plan to test the API for free as long as you stay within the quota limits. It’s your responsibility to review and acknowledge the plan’s usage limitations.

Staying within your API plan quota limit:

It is extremely important to know how close you are to the quota limit for your subscription. You will be charged for any additional usage that goes over the limit.

Testing an API

Now that you have subscribed to an API plan, you will want to head back to the ‘Endpoints’ tab. From here you can test the API endpoint directly in the browser by changing the input for the endpoint. Once you make a request to the API by using the ‘Test Endpoint’ button, you will also see the response directly in the browser.

alt text

If you’re happy with the response you see and decide that you want to connect your app to this API, simply switch back to the ‘Request Snippet’ tab. Now, select the programing language your app is using and copy the code snippet right into your app. We also provide an installation guide to help you get started with the request library provided.

alt text