Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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