GET /api/positions

Description

Returns list of persons positions, with reference to which organisation objects the positions belong to.

Parameters

user_name

String.  Optional. Username of person. If not given, will return positions for logged in person.

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 Position objects.

Security

Superuser, person’s manager and self

GET /api/roles

Description

Returns list of person’s roles, including positions.

Parameters

user_name

String.  Optional. Username of person. If not given, will return positions for logged in person.

term

String. Optional. Search term for role name.

competence_id

Integer.  Optional. Return a list of roles that this competence is defined as either mandatory or optional for. This attribute will override user_name if defined. Please not: The APIRole object will be tagged with an attribute called mandatory, which is True if competence is required for role, else False if optional

state 

String. Optional. When competence_id is specified, it is possible to specify whenter to fetch roles for which the competence is either mandatory or optional. Default is to return both mandatory and optional. Allowed values: "mandatory", "optional".

role_meta_types

String. Optional. Specify one or more role meta types to list, can be one of or combination of: role, specialrole or position. Example: role_meta_type=role fetches roles only, role_meta_type=role,specialrole fetches both roles and specialroles.

organisation_ids

List of ints. Optional. If present, limits the result to only roles available for these organisation units. Both extern_organisation_ids and organisation_ids can be sent in the same request.

extern_organisation_ids

List of ints. Optional. If present, limits the result to only roles available for these organisation units. Both extern_organisation_ids and organisation_ids can be sent in the same request.

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 Role objects.

Security

Superuser, person’s manager and self

Examples:

https://servername/api/roles?role_meta_types=role

Return list of roles of meta type 'role' for currently logged in user

https://servername/api/roles?role_meta_types=role&user_name=pe@snapper.no

Return list of roles of meta type 'role' for user with user name 'pe@snapper.no'.

GET /api/roles/[role_id]

Description

Get single role object.

Parameters

role_id

Int. Mandatory. The ID of the role to return.

fields

String. Optional. See Field customization.

Return

Array of one Role object.

Security

Superuser, superadmin and admin for the role