GET /api/organisations

Description

Returns list of organisation objects.

Parameters

start

DEPRECATED. Will be removed in future version. Use offset in stead.

limit

Int. Optional. Default: 20. Maximum: 100. Limit the size of the result set.

offset

Int. Optional. Default: 0. Offset the result set, starting at this index. For batching/paging.

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.

fields

String. Optional. See Field customization.

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.

fields

String. Optional. See Field customization.

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'

limit

Int. Optional. Default: 20. Maximum: 100. Limit the size of the result set.

offset

Int. Optional. Default: 0. Offset the result set, starting at this index. For batching/paging.

fields

String. Optional. See Field customization.

Return

Array of Person objects.

Security

Superuser, manager, only available to manager if manager for this particular object

PUT /api/organisations/[organisation_id]/organisationalfunctions

Set OrganisationalFunction to an organisation

organisationalfunction_ids Array of OrganisationalFunction-id's to add to the organisation

DOC NEEDS CLEANUP

fields

String. Optional. See Field customization.

DELETE /api/organisations/[organisation_id]/organisationalfunctions

Remove organisational function from an organisation

organisationalfunction_ids Array of OrganisationalFunction-id's to remove from the organisation

DOC NEEDS CLEANUP

fields

String. Optional. See Field customization.

POST /api/organisations

Create a new organisation.

 

Parameters

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.

fields

String. Optional. See Field customization.

Return

List of one Organisastion object if successful.

 

Examples

curl http://pet/api/login --data "user_name=peen&login=1&password=fdsafdsa"

Use "session_id" from the result and 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.