Home - YoussefMRefaat/timezone GitHub Wiki

General Notes

All requests' headers are expected to contain

{
"Content-Type" : "application/json",
"Accept" : "application/json"
}

If the request has an authentication token it should be presented in the header as

{ "Authorization" : ":token" }



Endpoints

Show all watches ordered by date in descending order

  • URL

/api/shop/new

  • Method

GET

  • URL Params

None

  • Data Params

None

  • Success response

Code: 200
Content: {"Message":"Watches have been retrieved successfully","Data":[{"id": :id,"name": :name,"description": :description,"image": :image,"price": :price } , {"id": :id,"name": :name,"description": :description,"image": :image,"price": :price} ...]}

  • Error response

None



Show all watches ordered by price in descending order

  • URL

/api/shop/highest

  • Method

GET

  • URL Params

None

  • Data Params

None

  • Success response

Code: 200
Content: {"Message":"Watches have been retrieved successfully","Data":[{"id": :id,"name": :name,"description": :description,"image": :image,"price": :price } , {"id": :id,"name": :name,"description": :description,"image": :image,"price": :price} ...]}

  • Error response

None



Show all watches ordered by date in ascending order

  • URL

/api/shop/lowest

  • Method

GET

  • URL Params

None

  • Data Params

None

  • Success response

Code: 200
Content: {"Message":"Watches have been retrieved successfully","Data":[{"id": :id,"name": :name,"description": :description,"image": :image,"price": :price } , {"id": :id,"name": :name,"description": :description,"image": :image,"price": :price} ...]}

  • Error response

None



Show most popular watches

  • URL

/api/shop/popular

  • Method

GET

  • URL Params

None

  • Data Params

None

  • Success response

Code: 200
Content: {"Message":"Watches have been retrieved successfully","Data":[{"id": :id,"name": :name,"description": :description,"image": :image,"price": :price } , {"id": :id,"name": :name,"description": :description,"image": :image,"price": :price} ...]}

  • Error response

None



Show a watch

  • URL

/api/shop/:id

  • Method

GET

  • URL Params

Required:

id=[integer]

  • Data Params

None

  • Success response

Code: 200
Content: {"Message":"Watch has been retrieved successfully", "Data":{ "id": :id,"name": :name,"description": :description,"image": :image,"price": :price,"in_cart: :number}}

  • Notes

in_cart is the quantity of this watch in the user's cart. 0 means the watch isn't in the cart or the user is not authenticated.

  • Error response

Code: 404 Content: { "Message" => "Watch not found" }

⚠️ **GitHub.com Fallback** ⚠️