Skip to content

Instantly share code, notes, and snippets.

@buritica
Created January 18, 2015 20:45
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 buritica/cd4692c8f6bff64f424f to your computer and use it in GitHub Desktop.
Save buritica/cd4692c8f6bff64f424f to your computer and use it in GitHub Desktop.
apiary resource template

Group Resource

Order [/resources/{id}]

Attribute Description type req Constraints
createdAt server generated Date
updatedAt server generated Date
  • Parameters

    • id (required, string, 545e9b16de59f0f007af07cc) ... Resource id
  • Model (application/ec.api+json)

    • Headers

    • Body

        {
            "resource": {
                createdAt: "2014-11-08T18:34:22.903Z",
                updatedAt: "2014-11-08T18:34:22.903Z"
            }
        }
      

Retrieve a Resource [GET]

  • Response 200

    [Resource][]

Update a Resource [PUT]

  • Request (application/json)

      {
          "resource": {
          }
      }
    
  • Response 200

    [Resource][]

Delete a Resource [DELETE]

  • Request (application/json)

  • Response 204

Resource Collection [/resources/]

  • Model (application/ec.api+json)

    • Headers

    • Body

        {
            "resources": [
                {
                    id: "545e9b16de59f0f007af07cc",
                    createdAt: "2014-11-08T18:34:22.903Z",
                    updatedAt: "2014-11-08T18:34:22.903Z"
                },
                {
                    id: "545eaaf95f8bfe885fc18722",
                    createdAt: "2014-11-08T22:39:48.339Z",
                    updatedAt: "2014-11-08T22:39:48.339Z"
                }
            ]
        }
      

Create a Resource [POST]

  • Request (application/json)

      {
          "resource": {
          }
      }
    
  • Response 201

      {
          "resource": {
              id: "545eaaf95f8bfe885fc18722",
              createdAt: "2014-11-08T22:39:48.339Z",
              updatedAt: "2014-11-08T22:39:48.339Z"
          }
      }
    

Retrieve list of Resources [GET]

  • Request (application/json)

  • Response 200 [Resource Collection][]

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