Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Sample Mockup API Apiary
FORMAT: 1A
HOST: https://api.ecommerce.com/
# Ecommerce API
API documentation for E-commerce
## Categories Collection [/categories{?page}{?limit}]
### List Categories [GET]
+ Parameters
+ page : 1 (number) - optional
+ limit : 20 (number) - optional
+ Response 200 (application/json)
{
"data":[
{
"id": 1,
"name": "BAGS",
"icon": "bags.png",
"created_at": "7843731823",
"updated_at": "7843731823"
},
{
"id": 2,
"name": "ACCESSORIES",
"icon": "accessories.png",
"created_at": "7843731823",
"updated_at": "7843731823"
},
{
"id": 3,
"name": "SHOES",
"icon": "shoes.png",
"created_at": "7843731823",
"updated_at": "7843731823"
},
{
"id": 4,
"name": "SMALL LEATHER GOODS",
"icon": "small-leather-goods.png",
"created_at": "7843731823",
"updated_at": "7843731823"
}
],
"meta": {
"total": 100,
"page": 1,
"limit":20
}
}
### Create a New Category [POST]
+ Request (application/json)
{
"name": "TIMEPIECE",
"icon": "timepiece.png"
}
+ Response 201 (application/json)
+ Headers
Location: /categories/15
+ Body
{
"name": "TIMEPIECE",
"icon": "timepiece.png",
"created_at": "7843731823",
"updated_at": "7843731823"
}
### Update Category [PUT /{id}]
+ Parameters
+ id (number) - ID of category must integer
+ Request (application/json)
{
"name": "TIMEPIECE",
"icon": "timepiece.png"
}
+ Response 204 (application/json)
### Detail Category [GET /{id}]
+ Parameters
+ id: 1 (number) - ID of category must integer
+ Response 200 (application/json)
{
"name": "TIMEPIECE",
"icon": "timepiece.png",
"created_at": "7843731823",
"updated_at": "7843731823"
}
### Delete Category [DELETE /{id}]
+ Parameters
+ id (number) - ID of category must integer
+ Response 204 (application/json)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment