Gastus API

Concepts

Show

GET /concepts/#{id}.xml

Returns a single concept.

Response

Status: 200 OK

<concept>
  <created-at type="datetime">2007-08-01T10:09:36Z</created-at>
  <description>Motorcycle Tyres</description>
  <id type="integer">49</id>
  <type-id type="integer">18</type-id>
  <updated-at type="datetime">2007-08-03T12:31:17Z</updated-at>
</concept>

List All

GET /concepts.xml

Returns a collection of concepts.

Response

Status: 200 OK

<concepts>
  <concept>
    ...
  </concept>

  <concept>
    ...
  </concept>
</concepts>

List With Type

GET /types/#{type-id}/concepts.xml

Returns a collection of concepts that belongs to a type.

Response

Status: 200 OK

<concepts>
  <concept>
    ...
  </concept>

  <concept>
    ...
  </concept>
</concepts>

Create

POST /concepts.xml

Creates a new concept. The XML for the new concept is returned on a successful request with the timestamps recorded and ids for the concept.

Request

<concept>
  <description>Car Tyres</description>
  <type-id type="integer">18</type-id>
</concept>

Response

Status: 201 Created
Location: http://test.gastus.com/concepts/#{new-concept-id}.xml

<concept>
  ...
</concept>

Update

PUT /concepts/#{id}.xml

Updates an existing concept with new details from the submitted XML.

Request

<concept>
  <description>Car Gasoline</description>
  <type-id type="integer">19</type-id>
</concept>

Response

Status: 200 OK

Destroy

DELETE /concepts/#{id}.xml

Destroys the concept at the referenced URL.

Response

Status: 200 OK