API stands for Application Programming Interface. An API helps to communicate to a system to retrieve information or perform a function. It defines the type of calls, methods to make them, data formats to be used, the conventions to follow etc.
REST (REpresentation State Transfer) is an architectural style for an application programming interface. The developers need not install libraries to take advantage of the REST API design. REST has the ability to handle multiple types of calls. Unlike SOAP API, which is restricted to XML, REST can return XML, JSON, YAML or any other format that the client requests.
It takes advantage of HTTP requests to access and use data.
· GET to retrieve a resource
· PUT to change or update a resource
· POST to create a resource
· DELETE to remove a resource
Image from https://www.w3schools.com
Anatomy of a request URL
A request URL is used to make the call. It is composed of keywords to indicate to the server what the request is.
Lets take a couple of URLs to understand the requests
Example 1 :
Example 2 :
Base path – It is the starting point of the API that is requested from
In the above examples,
Example 1 : The base path is https://www.amazon.com
Example 2 : The base path is https://www.indeed.com
The Endpoint – Determines the resource that is being requested for. Think of it like an automatic answering machine that asks you to press 1 for a service, press 2 for another service, 3 for yet another service and so on.
In the above examples,
Example 1 : /books-used-books-textbooks/b/
Example 2 : /jobs
Query Parameters – The final part of the URL is the query parameters. It gives the option to modify a request with key-value pairs. They always begin with a question marl ( ? ). Each. Parameter pair is separated by an ampersand ( & )
Example 1 : ie=UTF8&node=283155&ref_=nav_cs_books_788dc1d04dfe44a2b3249e7a7c245230
Example 2 : q=sdet&l=Edison%2C+NJ