GET /api/organisations
Description
Returns list of organisation objects.
Parameters
start
Int. Optional. Index to start at
limit
Int. Optional. Max length of result set
parent_id
Int. Optional. Restricts result set to organisation objects belong to this parent. parent_id=0 yields only root organisation objects.
user_name
String. Optional. Person’s username. If given, will return list of organisations person belongs to.
Return
Array of Organisation objects.
Security
Superuser, manager, will yield different results based on manager’s permissions
GET /api/organisations/[organisation_id]
Description
Returns detailed view of organisation object. :id is organisation ID.
Return
Array of one Organisation object.
Security
Superuser, manager, only available to manager if manager for this particular object
GET /api/organisations/[organisation_id]/persons
Description
Returns list of people in the organisation object.
/api/persons?organisation_id=123 will yield the same result as /api/organisations/123/persons.
Parameters
view
Optional. String. Either None or 'full' or 'simple'
Return
Array of Person objects.
Security
Superuser, manager, only available to manager if manager for this particular object
POST /api/organisations
Returns list of one organisation object that was created.
Test example:
curl http://pet/api/login --data "user_name=peen&login=1&password=fdsafdsa"
Use "session_id" from the result an set as tg-visit cookie:
curl --cookie "tg-visit=03dd783b1051326e110487a4125c52fceafdefee" --data "organisation_data[name]=TestUnitI&organisation_data[parent_id]=10&organisation_data[email]=jost@snapper.no&organisation_data[address]=Brattvollveien+261" http://pet/api/organisations
Creates a new organisation object.
organisation_data
Please note thet the reference to a parent organisation should be included in this parameter. If not passing or passing a parent_id=0 will make the new organisation object a root organisation.
Return
list of one APIOrganisastion object if successful.