GET /api/persons/[user_name]

Alias: GET /api/person

Description

Returns person info object for user name. If ”person” alias is used, will always return info for logged in user.

Parameters

fields

String. Optional. See Field customization.

Return

Array of one Person Object

Security

Superuser, person’s manager and self

GET /api/persons/

Description

Returns list of Persons 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.

organisation_id

Int. Optional. Limits the result set to members/employees of organisation.

organisation_ids

List of ints. Optional. Limits the result set to members/employees of the specified organisations. If both organisation_id and organisation_ids are specified, then the paramters are combined and the search will use ids specified in both paramters.

event_id

Int. Optional. Limits the result set to persons signed on to event. Cannot be used in conjuction with has_competence_ids, specified below

has_competence_ids

List of ints specifying comepetences that has to be fulfilled. Cannot be used in conjunction with event_id, specified above

role_ids

List of ints: Limit result set to persons matching specified roles

fields

String. Optional. See Field customization.

Return

Array of Person objects.

Security

Superuser, organisation’s manager if organisation_id is given

PUT /api/persons/[user_name]

Description

Updates person info for user name

Parameters

person_data

Object. All are optional unless otherwise noted. Not that object must be delivered on the "modern" format: "person_data[firstname]=John&person_data[lastname]=Doe". Only fields present will update person. Can contain the following fields:

  • user_name
  • password
  • firstname
  • lastname
  • jobtitle
  • mobile
  • email
  • birthdate
  • extern_person_id
  • address
  • postcode
  • city
  • phone
  • sex
  • notice
  • employee_code
  • profile_image
  • source
  • code
  • old_password: Required if password or user_name is present, and person is updating self. Not required if manager or superuser is updating. Must match previous password
  • password_match: Required if password or user_name is present, and person is updating self. Not required if manager or superuser is updating.. Must match password.

fields

String. Optional. See Field customization.

role_ids

List of integer. List of role ids specifying roles that should be set for the specified user

Return

Array of one Person object.

Security

Superuser, person’s manager and self

DELETE /api/persons/[user_name]

Description

Updates person info for user name

Parameters

role_ids

List of integer. List of role ids specifying roles that should be removed from the specified user

Return

Status as JSON

Security

Superuser, person’s manager and self

POST /api/persons

Creates new person. Input params are equal to the full view for APIPerson object.

Parameters

organisation_id

Int. Required. Where the new person object should reside.

role_id

Int. Reqired. What role the new person should have in connection to the passed org.

person_data

Json object. Data to update person with. Please note that the 'user_name' must be included in this object. Can contain the following fields:

  • user_name
  • password
  • firstname
  • lastname
  • jobtitle
  • mobile
  • email
  • birthdate
  • extern_person_id
  • address
  • postcode
  • city
  • phone
  • sex
  • notice
  • employee_code
  • profile_image
  • source
  • code

fields

String. Optional. See Field customization.