Skip to content

Instantly share code, notes, and snippets.

@jamesramsay
Last active August 29, 2015 14:05
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 jamesramsay/bbe70c35720fdce45c04 to your computer and use it in GitHub Desktop.
Save jamesramsay/bbe70c35720fdce45c04 to your computer and use it in GitHub Desktop.
API Blueprint puzzle #1

Group Creatives

Creative [/creatives/{creativeId}]

  • Parameters

    • creativeId (integer, 1) ... id of the creative
  • Model

    • Header

      Last-Modified: Sat, 21 Jun 2014 00:43:09 GMT
      
    • Body

      {
        "id": 1,
        "value": "http://example.com/123.swf",
        "status": "pending"
      }
      

GET

  • Response 200

    [Creative][]

PATCH

Approve or reject the creative.

  • Request (application/json)

    • Body

      {
        "status": "active"
      }
      
  • Response 201

    • Header

      Last-Modified: Sat, 21 Jun 2014 00:43:09 GMT
      
    • Body

      {
        "id": 1,
        "value": "http://example.com/123.swf",
        "status": "active"
      }
      

Creatives [/creatives]

POST

  • Request (application/json)

    • Body

      {
        "value": "http://example.com/123.swf"
      }
      
  • Response 201

    [Creative][]

@jamesramsay
Copy link
Author

It would be ideal if there was a way of passing the PATCHed values through to the response so that the blueprint would look like:

+ Request (application/json)

    + Body

      ```
      {
        "status": "active"
      }
      ```

+ Response 201

    [Creative][]

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