#Users
- User object
{
id: integer
username: string
email: string
created_at: datetime(iso 8601)
updated_at: datetime(iso 8601)
}
Returns all users in the system.
- URL Params
None - Data Params
None - Headers
Content-Type: application/json - Success Response:
- Code: 200
Content:
{
users: [
{<user_object>},
{<user_object>},
{<user_object>}
]
}
Returns the specified user.
- URL Params
Required:id=[integer]
- Data Params
None - Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
- Code: 200
Content:{ <user_object> }
- Error Response:
- Code: 404
Content:{ error : "User doesn't exist" }
OR - Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
- Code: 404
Returns all Orders associated with the specified user.
- URL Params
Required:id=[integer]
- Data Params
None - Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
- Code: 200
Content:
{
orders: [
{<order_object>},
{<order_object>},
{<order_object>}
]
}
- Error Response:
- Code: 404
Content:{ error : "User doesn't exist" }
OR - Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
- Code: 404
Creates a new User and returns the new object.
- URL Params
None - Headers
Content-Type: application/json - Data Params
{
username: string,
email: string
}
- Success Response:
- Code: 200
Content:{ <user_object> }
Updates fields on the specified user and returns the updated object.
- URL Params
Required:id=[integer]
- Data Params
{
username: string,
email: string
}
- Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
- Code: 200
Content:{ <user_object> }
- Error Response:
- Code: 404
Content:{ error : "User doesn't exist" }
OR - Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
- Code: 404
Deletes the specified user.
- URL Params
Required:id=[integer]
- Data Params
None - Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
- Code: 204
- Error Response:
- Code: 404
Content:{ error : "User doesn't exist" }
OR - Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
- Code: 404
#Products
- Product object
{
id: integer
name: string
cost: float(2)
available_quantity: integer
created_at: datetime(iso 8601)
updated_at: datetime(iso 8601)
}
Returns all products in the system.
- URL Params
None - Data Params
None - Headers
Content-Type: application/json - Success Response:
- Code: 200
Content:
{
products: [
{<product_object>},
{<product_object>},
{<product_object>}
]
}
Returns the specified product.
- URL Params
Required:id=[integer]
- Data Params
None - Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
- Code: 200
Content:{ <product_object> }
- Error Response:
- Code: 404
Content:{ error : "Product doesn't exist" }
OR - Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
- Code: 404
Returns all Orders associated with the specified product.
- URL Params
Required:id=[integer]
- Data Params
None - Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
- Code: 200
Content:
{
orders: [
{<order_object>},
{<order_object>},
{<order_object>}
]
}
- Error Response:
- Code: 404
Content:{ error : "Product doesn't exist" }
OR - Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
- Code: 404
Creates a new Product and returns the new object.
- URL Params
None - Data Params
{
name: string
cost: float(2)
available_quantity: integer
}
- Headers
Content-Type: application/json - Success Response:
- Code: 200
Content:{ <product_object> }
Updates fields on the specified product and returns the updated object.
- URL Params
Required:id=[integer]
- Data Params
{
name: string
cost: float(2)
available_quantity: integer
}
- Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
- Code: 200
Content:{ <product_object> }
- Error Response:
- Code: 404
Content:{ error : "Product doesn't exist" }
OR - Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
- Code: 404
Deletes the specified product.
- URL Params
Required:id=[integer]
- Data Params
None - Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
- Code: 204
- Error Response:
- Code: 404
Content:{ error : "Product doesn't exist" }
OR - Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
- Code: 404
#Orders
- Order object
{
id: integer
user_id: <user_id>
total: float(2)
products: [
{
product: <product_id>,
quantity: integer
},
{
product: <product_id>,
quantity: integer
},
{
product: <product_id>,
quantity: integer
},
]
created_at: datetime(iso 8601)
updated_at: datetime(iso 8601)
}
Returns all users in the system.
- URL Params
None - Data Params
None - Headers
Content-Type: application/json - Success Response:
- Code: 200
Content:
{
orders: [
{<order_object>},
{<order_object>},
{<order_object>}
]
}
Returns the specified order.
- URL Params
Required:id=[integer]
- Data Params
None - Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
- Code: 200
Content:{ <order_object> }
- Error Response:
- Code: 404
Content:{ error : "Order doesn't exist" }
OR - Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
- Code: 404
Returns all Products associated with the specified order.
- URL Params
Required:id=[integer]
- Data Params
None - Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
- Code: 200
Content:
{
products: [
{<product_object>},
{<product_object>},
{<product_object>}
]
}
- Error Response:
- Code: 404
Content:{ error : "Order doesn't exist" }
OR - Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
- Code: 404
Returns all Users associated with the specified order.
- URL Params
Required:id=[integer]
- Data Params
None - Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
{ <user_object> }
- Error Response:
- Code: 404
Content:{ error : "Order doesn't exist" }
OR - Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
- Code: 404
Creates a new Order and returns the new object.
- URL Params
None - Data Params
{
user_id: <user_id>
product: <product_id>,
quantity: integer
}
- Headers
Content-Type: application/json - Success Response:
- Code: 200
Content:{ <order_object> }
Updates fields on the specified order and returns the updated object.
- URL Params
Required:id=[integer]
- Data Params
{
product: <product_id>,
quantity: integer
}
- Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
- Code: 200
Content:{ <order_object> }
- Error Response:
- Code: 404
Content:{ error : "Order doesn't exist" }
OR - Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
- Code: 404
Deletes the specified order.
- URL Params
Required:id=[integer]
- Data Params
None - Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
- Code: 204
- Error Response:
- Code: 404
Content:{ error : "Order doesn't exist" }
OR - Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
- Code: 404