REST API entry point and endpoint

David Sarpong picture David Sarpong · Nov 8, 2018 · Viewed 9.6k times · Source

What is a REST API entry point and how is it different from an endpoint?

I have searched for various definitions online but still can't seem to wrap my head around them (I am new to APIs in general). From what I understand, they provide means of communicating with the server but what are they exactly and how are entry points and endpoints similar or different?

Answer

tiomno picture tiomno · Jun 14, 2019

Agree with Roman Vottner here and gave a thumb up. I only want to add a few more links here for anyone trying to get a clear idea.

API Endpoint

I like the answer here: https://smartbear.com/learn/performance-monitoring/api-endpoints/

"Simply put, an endpoint is one end of a communication channel. When an API interacts with another system, the touchpoints of this communication are considered endpoints. For APIs, an endpoint can include a URL of a server or service. Each endpoint is the location from which APIs can access the resources they need to carry out their function."

And samples here: What is an Endpoint?

  https://example.com/api/login
  https://example.com/api/accounts
  https://example.com/api/cart/items

API Entry Point

Look here: https://restful-api-design.readthedocs.io/en/latest/urls.html

"A RESTful API needs to have one and exactly one entry point. The URL of the entry point needs to be communicated to API clients so that they can find the API. Technically speaking, the entry point can be seen as a singleton resource that exists outside any collection."

So, following the previous example, it would be:

  https://example.com/api

Extra note: in GraphQL world, there is a single endpoint for the API, no entry point (https://graphql.org/learn/best-practices/#http). Usually in the form

  https://example.com/graphql