Term
Definition
API
Application Programming Interface - a collection of methods of communication for building and interacting with software. It’s how one computer talks to another computer.
Web API
A collection of endpoints that supply data to applications. They define the routes and types of responses the client can expect to receive after hitting those routes.
REST APIs
Web APIs that conform to the REST architectural style principles. They are typically useful for CRUD operations. Client sends request to server that has a REST API standard interface, which accepts the request, updates any resources, and sends back a JSON response to client.
HTTP Methods
Requests from client to server. Main methods include GET, POST, PUT/PATCH, and DELETE.
GET Method
Gets data from the server.
POST Method
Submits data to the server.
PUT/PATCH Methods
Updates resource already on the server. PUT will update the entire resource, PATCH will update portion of resource but not all browsers support PATCH requests.
DELETE Method
Deletes data from the server.
HTTP Status Codes
Responses sent from server to indicate the result of a request.
1xx Status Codes
Informational responses.
2xx Status Codes
Success responses. 200: OK, 201: Created, 202: Accepted, 204: No Content.
3xx Status Codes
Redirect responses - further action must be taken. 301: Moved Permanently, 302: Found but temporarily moved to somewhere else, 304: Not Modified.
4xx Status Codes
Client error responses. 400: Bad Request, 401: Unauthorized, 404: Not Found, 405: Method Not Allowed.
5xx Status Codes
Server error responses. 500: Internal Server Error - server had a problem and couldn’t process the request, out of your control.
API Keys
Passwords to access an API and perform some action.
API Tokens
Like a password to access an API key.
Service
Software or system that provides a set of functionality. Some common functionalities are authentication, data processing, or communication with other systems.
Resource
Data that can be manipulated by an application, such as a file, object, database record, or a network connection. Resources are typically consumed by an API or other interface that allows interaction with the application.
How to Test APIs - Step 1
Make a request using a tool like Postman or curl, and see if the response is what you expected.
How to Test APIs - Step 2
Verify the response status code is 200 or 201. Ask for the response body and verify the data is what you expected.
How to Test APIs - Step 3
Verify the Database. Query the database to see if the data was actually created in the database.