What are API Endpoints?

Pull Quote here Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation

What is an API?

API (Application Programming Interface) is code which bridges data exchange between two applications. 

What are API Endpoints?

An API endpoint lies at one end which receives, processes requests from an application and then sends the information requested. It can be defined as the URL (Uniform Resource Locator) for a server or a service.

How are API endpoints used?

Let's suppose you want to build a FinTech website that has the functionality to display information on digital or tangible assets such as cryptocurrency, fiat currency, stocks, gold, or silver. The application might need a third party or a separate entity dedicated to providing updates on cryptocurrency, another one for fiat currency, stocks, and so on. The APIs provided by these companies can be used in a single application to display information for all these different assets.

Similarly, trading bots use APIs from finance websites and applications to access information on assets to execute trading operations.

Your applications will be receiving information by sending requests via APIs, the address where the respective requests are directed is known as an endpoint.

How do API Endpoints work?

API endpoints can be accessed using methods under the HTTP communication protocol.

The following methods can be used to perform CRUD ( create, read, update, delete) operations in RESTful services :

GET: You can retrieve data from an endpoint. For example, retrieve your profile picture to be displayed when you log into Twitter.

POST: Insert data in the servers located at the endpoint e.g. uploading a new tweet on your feed.

PUT & PATCH: Update or modify existing data e.g updating your account’s email address.

DELETE: remove specific data at the endpoint location e.g. deleting a tweet.

Examples of API Endpoints

Details on how to access the API endpoints are provided in the documentation of the service you intend on using. 

For instance, if you want to build an online e-commerce website and use Google Firestore as the backend storage option, the documentation provides code snippets on how to perform CRUD operations whenever the database needs to be accessed, consider the following code:

---------------------------------------------------------------------------------------------------------------------------

curl -X PUT -d '{ "first": "Jack", "last": "Sparrow" }' \

  'https://[PROJECT_ID].firebaseio.com/users/jack/name.json'

---------------------------------------------------------------------------------------------------------------------------

This command contains the HTTP method PUT, followed by NoSQL data, and finally a URL or an endpoint where the data object is to be stored, if the operation is successful it returns a 200 OK status code.

Similarly, the following code is used for a delete request:

---------------------------------------------------------------------------------------------------------------------------

curl -X DELETE \

  'https://[PROJECT_ID].firebaseio.com/users/jack/name/last.json'

---------------------------------------------------------------------------------------------------------------------------

This code sends a request from your application to the firestore database URL or the endpoint. Successful execution results in the file “last.json” being deleted from the specified directory.

Closing thoughts

When two applications are connected via an API, the endpoint lies at one end which processes and sends responses to requests; these requests can be in the form of HTTP methods to perform CRUD operations in a database. APIs exist for many applications such as Facebook, Instagram, Netflix, and Github and can be used to integrate third-party services as well.

MORE TO EXPLORE
CATEGORY

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

CATEGORY

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

CATEGORY

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Resources

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labor

Learn more
RESOURCE TITLE
Text linkText link
RESOURCE TITLE
Text linkText link
RESOURCE TITLE
Text linkText link