Understanding API Endpoints: Identifying which Magic Spell to Use ???♂?

Understanding API Endpoints: Identifying which Magic Spell to Use ??♂?

Hello everyone, hope you are doing well in this hot summer. I was trying a Third-Party Integration with my system, which got my attention on API URLs which I was integrating with.

Although it seems it just a URL which brings/updates some resource on the server, but knowing about URLs structure can tell you how the system was designed.

Let's dive into it!

understanding request parts

Before making requests, we have to understand what the parts of requests are (to be precise HTTP requests) There are three main parts of a HTTP request:

  1. HTTP Method
  2. Body
  3. URL


1) HTTP Method

HTTP Method defines what actions to be taken on a particular resource (or entity). There are many HTTP methods but GET/POST/PUT/PATCH/DELETE are mostly used as per the requirements.

Check out interesting article for better understanding: https://www.dhirubhai.net/pulse/http-standard-methods-why-you-should-use-them-mahmoud-mahmoud/


Popular HTTP methods

2) Body

Body denotes what data needs to be stored in server. This part of request is not required always. For e.g. if we just want to access or delete some data on server, sending data while requesting is useless. A typical JSON body structure while creating/updating a entity looks like this:

Dummy Body (JSON) example

3) URLs:

Uniform Resource Locator or URL are the path to entity we can find it. It servers like an address. For e.g. when you want to meet your friend, for this you should know where to look for them or their address.

Similarly the entities can be referred as:

A typical structure of URL depends upon the requirements; however we can categorize three commonly seen structures

api/version -> denotes the version of URL,

it allows to have a separation of older-newer system. API version is not mandatory, but considered as a good practice.

Examples of Two different versions

api/v1 ----> version 1 of the system

api/v3 ----> version 3 of the system (newer version)

3.1) Resource or entity address link

As discussed above resources can be any of the entity like files

Different API versioning pointing to a resource

For e.g. https://mycoolsite??.abcd/api/v1/dashing-harry-potter-image This dummy URL will locate a image file named dashing-harry-potter-image file.

But Resource can be the JSON data as well. For e.g. https://jsonplaceholder.typicode.com/comments This URL will locate JSON data of comments list.

I have created a similar API to list Product listing

Pointing to product listing


  • GET method will retrieve list of entities (list of products)
  • POST method will create a new entity (adding new product)

3.2) Query Parameters (or Params)

Query Params are the part of URL which in which client sends some data while requesting. Usually, these query params are used for filter (but can be used for new data addition which is not recommended). Typically query params link has following structure:

key1, key2 and key3 are query params

key1 is the parameter name with value params1. key2 is the parameter name with value params2. and so on...


search is query param to filter list of products

Here search is query parameter name with value "app". This will filter products which has app in their name. Now how to identify what are key and values to be provided, for this documentation must be referred or directly communicating with the developer who developed it.

3.3) Path Parameter

Path parameter denotes to target a specific entity. In following example identification of that specific entity is done by ID parameter

id is the path parameter here

  • GET method will retrieve detail of the entity as shown in below exampl

Product with ID 3, a special phone if you are Hera Pheri fan ??

  • PUT/PATCH: These two methods will update the record the data of that particular entity. I am not giving here example, might be for later post ??. But it will seems like:

Updating Water to Rum ????

  • DELETE: This method when used on URL with path parameter will delete the record of the entity from the database

Deleting a Resource


3.3.1) Specific action on Path Parameter

You can also perform some specific action on Path parameter URL, like downloading/uploading or getting data from related tables.

URL structure looks like this.

some action to be performed on resource with id

I have used the last examples of getting all the Order Items in which Product with ID 3 was used.

Getting all order items of product with ID 2

Identify what the path to be provided, documentation has to be referred or directly communicating with the developer who developed it.

I hope you have found something interesting to learn. Till the bye ????

Byeeeeee ??????





Arjun Dange

Python Full Stack Developer

9 个月

Awesome sir!

要查看或添加评论,请登录

Mohitkumar Talreja的更多文章

  • Tar Compression: tarfile library in python

    Tar Compression: tarfile library in python

    Tar stands for Tape Archive is an archive file [record file] which is created by making group of some files. In the…

  • Decoding Computer Network Ports: Your Gateway to Digital Conversations

    Decoding Computer Network Ports: Your Gateway to Digital Conversations

    What are Computer Network ports ? How are the assigned ? Are they required ? I will try to answer all of these question…

    1 条评论
  • Templates searching in Django

    Templates searching in Django

    Hello Wizards, welcome to Django witchcraft ??, in this article We will see how does template searching works in Django…

  • Permissions: MAGICAL abilities to do THINGs ??

    Permissions: MAGICAL abilities to do THINGs ??

    Another BLOG on Authentication VS Authorization ??. Well no, in this blog I try to explain to you the Authorization and…

  • Django Extensions (cherry on the top)

    Django Extensions (cherry on the top)

    Hello Guys, Namaste! My name is Mohit, and I will discuss a library that enhances the Django App development process…

    2 条评论

社区洞察

其他会员也浏览了