17 May The Non-Programmer
Even when you do not know what an API is, you have undoubtedly interacted with one.
At this time, we take connectivity between know-how largely with no consideration. For example, we do not query once we use OpenTable to make a reservation at a close-by restaurant.
Alternatively, for those who use Kayak.com to guide flights, you have in all probability by no means puzzled, Wait a minute … how does Kayak know JetBlue has an open seat in 27A?
Finally, any time you want purposes to speak with each other, you want an API, or software programming interface.
Right here, we’ll discover what an API is, and why you’d want to make use of one. Even for those who’re not a programmer and do not want to know intensive technical jargon, it’s best to nonetheless perceive the fundamentals, since these days, integrations between know-how are sometimes important elements of anybody’s job.
What’s an API?
At its most elementary definition, an API lets one piece of software program discuss to a different piece of software program.
To grasp an API in motion, let’s contemplate a real-life instance — HubSpot’s integration with Typeform. Typeform, a instrument that provides mobile-ready quizzes, contact kinds, and signup kinds, must combine with HubSpot’s Types API to to work together with the kinds instrument and seamlessly ship submissions from Typeform kinds into the HubSpot CRM.
To do that, Typeform’s API and HubSpot’s API want to speak. An integration can act as a translator, making certain every API’s data is accurately translated for the opposite software — on this case, the mixing could be sure that Typeform type fields are accurately mapped to the corresponding HubSpot fields.
Isaac Takushi, a HubSpot Developer Assist Specialist, explains — “You may consider APIs and the ‘endpoints’ they comprise as entry factors for various data. Every API endpoint could solely have one particular job. When mixed, nonetheless, totally different endpoints can help highly effective, multifaceted integrations.”
Kayak.com, for example, wants some API to speak with JetBlue’s methods. While you search “Boston to Charlotte” in Kayak, JetBlue’s reserving API will primarily obtain this request from Kayak, pull up data associated to that request, and ship it again. Nonetheless, Kayak will want its personal API or code to know and act on the data the JetBlue API returned.
Easy methods to use an API
To make use of an API, you usually want the API key, since most APIs require it. Check out the APIs documentation for entry necessities. Then, discover an HTTP shopper on-line, reminiscent of Postman or Runscope. These instruments will enable you to entry the API along with your API key with little or no coding required.
To make use of an API, you will wish to try the API’s documentation for entry necessities. For example, HubSpot’s Contacts API requires authentication:
After getting entry necessities, you should use a instrument like Postman or Runscope to manually work together with an API. These third-party instruments, or “REST purchasers,” assist you to make one-off requests to API endpoints with out coding. They’re nice for getting a really feel for what your backend methods could do mechanically. Try this useful resource on the way to make your very first API request with Postman.
For those who’re not fairly prepared to leap in on the deep finish with a REST shopper, strive punching the next into your browser:
It is a public API endpoint from the free REST International locations service. Particularly, we’re utilizing the “Identify” endpoint, which accepts nation names as search queries. A profitable search will return potential nation matches, together with key details about every nation. On this case, we’re trying to find international locations with names that comprise the phrase “united.”
It is best to see following block of JSON knowledge returned:
Congratulations! You simply made an API request out of your browser!
The endpoint returned uncooked knowledge (formatted in JSON) on international locations with “united” within the identify.
It might not look fairly, however keep in mind that APIs are designed for purposes, which do not require the styling people anticipate on an HTML internet web page. Whilst you can simply Google “international locations that start with ‘united’,” purposes can’t. They could should depend on providers like REST International locations to search for that data.
For those who’re uncertain whether or not it’s best to use your in-house builders to create APIs or look externally, try First vs. Third-Social gathering APIs: What You Must Know.
Initially printed Might 17, 2019 7:00:00 AM, up to date Might 17 2019