API

Elite Tech API to get all the PC Hardware Information

Table Of Contents

API Routes

For Users, these are API routes for the GET request methods.

And for System Owners like Stores or Websites, there are 2 API routes for the GET request methods, and 1 route for each request method of the following, POST, PUT DELETE.

Usage

For the GET method, you can use your browser to get whatever you want!

Or with any script from your favorite programming language, you can use Python requests for example if you want to navigate through the API.

Here are all the available Hardware types in the API:

Usage for the Systems

And for the other requests, POST, PUT, and Delete, that will be of course in your system or website. But if you want to use the other methods separately, you can choose between plenty of tools that will help you make a request. For example, curl in the terminal, or RestMan Chrome Extension, or the Postman application.

Examples

GET

Here are simple demonstrations of using the GET routes:

Here are the options that you can add in the query:

You can also apply pagination in the API

POST

Using your favorite tool, just make a POST request with this route /api/:type/ and add the header Content-Type with the value application/json and add to the body the Information for the new product.

Usgin curl for example:

($) curl -X POST http://yourwebsite.com/api/case -H "Content-Type: application/json" -d '{"name": "Cooler Master MB511", "manufacturer": "Cooler Master"}'
{"id":805}

DELETE

Using your favorite tool, just make a DELETE request with this route /api/:type/:id to delete an item.

Usgin curl for example:

($) curl -X DELETE http://yourwebsite.com/api/case/55
55

PUT

Using your favorite tool, just make a PUT request with this route /api/:type/:id and add the header Content-Type with the value application/json and add to the body the new information you want to update for the product.

Usgin curl for example:

($) curl -X PUT http://localhost:3000/api/case/805 -H "Content-Type: application/json" -d '{"color": "Black"}'
[{"id":805,"imageURL":null,"name":"Cooler Master MB511","type":null,"color":"Black","powerSupply":null,
"sidePanel":null,"externalVolume":null,"internalBays":null,"manufacturer":"Cooler Master",
"rating":null,"price":null,"stock":null}]