Skip to content

Instantly share code, notes, and snippets.

@zdne
Last active December 21, 2015 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zdne/6291718 to your computer and use it in GitHub Desktop.
Save zdne/6291718 to your computer and use it in GitHub Desktop.
API Blueprint collection example – http://apiblueprint.org
# Collection API
# Group Coupons
Group of all coupon-related resources.
## Coupon [/coupons/{id}]
A resource representing one coupon.
+ Coupon Object (application/json)
{ "label" : "Red" }
### Retrieve a Coupon [GET]
+ Response 200
[Coupon][]
### Erase a coupon [DELETE]
+ Response 204
## Coupons [/coupons{?limit}]
A resource representing all coupons in the system.
+ Coupon Collection Object (application/json)
[ { "label" : "Red" }, { "label" : "Green" }, { "label" : "Blue" } ]
### Retrieve all Coupons [GET]
+ Response 200
[Coupon Collection][]
### Create a Coupon [POST]
+ Request
[Coupon][]
+ Response 201 (text/plain)
Created.

Collection API

Group Coupons

Group of all coupon-related resources.

Coupon [/coupons/{id}]

A resource representing one coupon.

  • Coupon Object (application/json)

      { "label" : "Red" }
    

Retrieve a Coupon [GET]

  • Response 200

    [Coupon][]

Erase a coupon [DELETE]

  • Response 204

Coupons [/coupons{?limit}]

A resource representing all coupons in the system.

  • Coupon Collection Object (application/json)

      [ { "label" : "Red" }, { "label" : "Green" }, { "label" : "Blue" } ]
    

Retrieve all Coupons [GET]

  • Response 200

    [Coupon Collection][]

Create a Coupon [POST]

  • Request

    [Coupon][]

  • Response 201 (text/plain)

      Created.
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment