If the application is currently running and records are loaded into the database, clicking on an example will cause the web browser to open a new tab and render the API outcome.
Alternatively, to test the API endpoint u can turn on the Swagger API UI and test it directly with the application.
Get All Product
GEThttp://localhost:5000/product
Get all the records w/o sorting or pagination involved.
No parameters are required to be passed in order to use this API.
An API which helps to get all the products from the product's table.
Get all the records + allows single or multiple sorting
1. optional to pass {orderByName} -> if passed as PARAM_QUERY will sort based on possible values
2. optional to pass {orderByPrice} -> if passed as PARAM_QUERY will sort based on possible values
3. if multiple sort is specified, then it will be sorted by name then price.
4. if other values is provided to orderByName / orderByPrice, it will disregard the value and sort it in ascending order.
Query Parameters
Name
Type
Description
orderByPrice
string
Accepts
asc sort by Ascending Order
desc sort by Descending Order
orderByName
string
Accepts
asc sort by Ascending Orderdescsort byDescending Order
get one product by ID, only numbers(integer) are accepted.
If product ID does not exist, it will return 404 error. Currently data preparation ID's are (1 - 500) are valid records. ID 501 and later does not exist unless added. Can use these data for data testing scenarios.
Path Parameters
Name
Type
Description
id
number
any number from one to infinity -> possible values: ( 1 ... n )the product
get products by filtering price (within min - max range) or (>= min) or (<= max) then sorting
1. {minprice} - OPTIONAL_PARAMETER, query will still work w/o min price input
2. {maxprice) - OPTIONAL_PARAMETER, query will still work w/o max price input
3. optional to pass {orderByName} -> query will still work w/o inputing min or max value
4. optional to pass {orderByPrice} -> query will still work w/o input min or max value
5. if multiple sort is specified, then it will be sorted by name then price.
6. if other values is provided to orderByName / orderByPrice, it will disregard the value and sort it in ascending order.
Query Parameters
Name
Type
Description
minprice
number
minimum price - cannot be less than 0
maxprice
number
max maximum price - cannot be more than 9999
orderByPrice
string
Accepts
asc sort by Ascending Order
desc sort by Descending Order
orderByName
string
Accepts
asc sort by Ascending Orderdescsort byDescending Order
get products by filtering name using the like clause + sorting
1. {name) - REQUIRED PARAMETER, query will search for name of product and returns the product name which has the text name in it
2. optional to pass {orderByName} -> query will still work w/o inputing min or max value
3. optional to pass {orderByPrice} -> query will still work w/o input min or max value
4. if multiple sort is specified, then it will be sorted by name then price.
5. if other values is provided to orderByName / orderByPrice , it will disregard the value and sort it in ascending order.
Path Parameters
Name
Type
Description
name
string
name of the product -> will be filtered using like clause
Query Parameters
Name
Type
Description
orderByPrice
string
Accepts
asc sort by Ascending Order
desc sort by Descending Order
orderByName
string
Accepts
asc sort by Ascending Orderdescsort byDescending Order