Skip to content
kvavliak edited this page Jul 9, 2012 · 3 revisions

RESTful protocol for Persons.

The following Foreign Key apply:

persons.inst_id : Foreign Key to Installations

READ Persons

GET /api/inst_id?=inst_id | show

Fetches the Persons of an Installation using the query parameter inst_id.

Consumes: Route

Produces: JSON

READ Person

GET /api/pers_id/{pers-id} | show

Fetches the properties of the Person and other included entities (names, ids)

Consumes: Route

Produces: JSON

{ "success": true, "message": "Person retrieved successfully", "size": 1, "data": [ { "_id": { "$oid": "4ff5bca7e4b0082c63d08dfa" }, "name": "Person 1", "type": "Family", "description": "Person description", "inst_id": "4ff5bca7e4b0082c63d08df7" } ] }

CREATE Person

POST /api/pers | create

Creates a new Person based on the things added in the form.

Consumes: Route, JSON

{ name: "Person 1", type : "Family", description : "Person description", inst_id: "4ff5bb0ee4b0b73027c86680" }

Produces: JSON

UPDATE Person

PUT /api/pers/{pers-id} | update

Updates the properties of the Person after editing.

Consumes: Route, JSON

Produces: JSON with update status

DELETE Person

DELETE /api/pers/{pers-id} | delete

Deletes the existing Person.

Consumes: Route

Produces: Delete status

Clone this wiki locally