Product
This page contains the documentation for the product endpoints.
The product endpoints allow you to get the list of products available and the details. You can also get the picture of the product. If your account has administrative rights, you can modify and delete a product.
This endpoint allows you get the list of available products. It shows all available product.
Successful response. Returns a list of product.
See message description.
see message description.
GET /products HTTP/1.1
Host: thefurniturebros.com
Accept: */*
[
{
"_id": "6555a1f49feeac7dccd9b1ee",
"name": "brown tablede",
"image": "1700110836527.webp",
"price": 30,
"description": "this is a brown table",
"soldCount": 90,
"__v": 0
}
]This endpoint allows you get the image of the product. The image is in the .webp format.
The product image filename to use. Use the GET Product list endpoint to view all products and their image filenames.
1700110836527.webpSuccessful response. Returns the image of the product.
See message description.
see message description.
GET /products/{filename} HTTP/1.1
Host: thefurniturebros.com
Accept: */*
binaryThis endpoint allows you to edit a product.
Provide your API key.
The product image filename to use. Use the GET Product list endpoint to view all products and their image filenames.
1700110836527.webpThe new name of the product.
sample_itemThe new filename of the product's image.
The new price of the product.
50The new description of the product.
sample descriptionThe new total number of units sold.
35Successful response. Returns the new information of the product.
See message description.
see message description.
PUT /products/{filename} HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 100
{
"name": "sample_item",
"image": "binary",
"price": 50,
"description": "sample description",
"soldCount": 35
}{
"msg": "Product updated successfully",
"updatedProduct": {
"_id": "6555a1f49feeac7dccd9b1ee",
"name": "brown tablede",
"image": "1700110836527.webp",
"price": 30,
"description": "this is a brown table",
"soldCount": 90,
"__v": 0
}
}This endpoint allows you get delete a product.
Provide your API key.
The product image filename to use. Use the GET Product list endpoint to view all products and their image filenames.
1701082686603.webpSuccessful response. Returns the status of the operation.
See message description.
see message description.
DELETE /products/{filename} HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Accept: */*
{
"msg": "Item deleted"
}This endpoint allows you get the details of a product.
The product image filename to use. Use the GET Product list endpoint to view all products and their image filenames.
Successful response. Returns the information of the product
See message description.
see message description.
GET /products/details/{filename} HTTP/1.1
Host: thefurniturebros.com
Accept: */*
{
"_id": "6555a1f49feeac7dccd9b1ee",
"name": "brown tablede",
"image": "1700110836527.webp",
"price": 30,
"description": "this is a brown table",
"soldCount": 90,
"__v": 0
}This endpoint allows you to upload a product.
Provide your API key.
The name of the product.
sample itemThe filename of the product's image.
The price of the product.
50The description of the product.
sample descriptionThe total number of units sold.
35Successful response. Returns the status of the operation.
POST /products/upload HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 100
{
"name": "sample item",
"image": "binary",
"price": 50,
"description": "sample description",
"soldCount": 35
}Successful response. Returns the status of the operation.
{
"msg": "product saved succesfully"
}Last updated