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

RESTful protocol for Activities.

The following Foreign Key apply:

activities.pers_id : Foreign Key to Persons

READ Activities

GET /api/act?pers_id={pers_id} | index

Fetches the Activities of a Perosn using the query parameter pers_id.

Consumes: Route, Parameter

Produces: JSON

READ Activity

GET /api/act/{act-id} | show

Fetches the properties of the Activity and other included entities (names, ids) such as ActivityModels.

Consumes: Route

Produces: JSON

{ "success": true, "message": "Activities retrieved successfully", "size": 2, "data": [ { "_id": { "$oid": "4ff5bca7e4b0082c63d08dfb" }, "name": "Cooking2", "type": "Coocking", "description": "Bla bla2", "pers_id": "4ff5bca7e4b0082c63d08dfa" }, { "_id": { "$oid": "4ff5bca7e4b0082c63d08dfc" }, "name": "Ironing", "description": "Bla bla Ironing", "pers_id": "4ff5bca7e4b0082c63d08dfa" } ] }

CREATE Activity

POST /api/act | create

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

Consumes: Route, JSON

{ name: "Cooking2", type : "Coocking", description: "Bla bla2", pers_id: "4ff410c8e4b0c338f131dea3" }

Produces: JSON

UPDATE Activity

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

Updates the properties of the Activity after editing.

Consumes: Route, JSON

{ name: "Cooking2", type : "Coocking", description: "Bla bla2", pers_id: "4ff410c8e4b0c338f131dea3" }

Produces: JSON with update status

DELETE Activity

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

Deletes the existing Activity.

Consumes: Route

Produces: Delete status

Clone this wiki locally