GET /api/personevents

Description

Returns list of events for user, for organisation, or just searches for person-events if neither user_name nor organisation_id is given (this is allowed only for superuser and superadmin users).

Parameters

person_event_ids

List of ints. Optional. IDs to specific PersonEvent objects.

user_name

String. Optional. User name for user. Will NOT return for logged in user if not present.

organisation_id

Int. Optional. Return personevents for persons belonging to organiasation unit. Will override user_name parameter.

event_ids

Array of ints. Optional. Limit to these events.

mode

String. Optional. ”future”/”finished”/”all”.  Controls if we are to get future or finished events, or both. Default: ”future”

waitlist

Int. Optional. 0/1. Return person events for which person is on waitlist or not. Default 0.

confirmed

Int. Optional. 0/1. Return person events that are confirmed/not confirmed. If parameter is omitted, will return both confirmed and not confirmed.

include_person

Int. Optional. Set to 1 if person information should be included to the returned PersonEvent object. When specifying organisation id, this parameter is default set to 1  (TRUE), else default 0 (FALSE).

startdate

Date. Optional. Get PersonEvents starting after this date.

enddate

Date. Optional. Get PersonEvents starting before this date.

host_organisation_ids

List of ints. Optional. Get only PersonEvents where Event is hosted by these organisations.

host_organisation_external_ids

List of ints. Optional. Same as host_organisation_ids, only using "external" organisation identifier instead.

representing_organisation_ids

List of ints. Optional. Get only PersonEvents where person is defined as representing these organisations.

representing_organisation_external_ids

List of ints. Optional. Same as representing_organisation_ids, only using "external" organisation identifier instead.

sort_direction

String. "asc"/"desc". Whether the result should be sorted ascendingly or descendingly. Default: "asc". 

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.

fields

String. Optional. See Field customization.

Return

Array of PersonEvent objects.

Security

Superuser, manager, self

GET /api/personevents/[event_id]

Description

Get detailed view of event for person. Will return empty list if person is not signed on to event.

Parameters

fields

String. Optional. See Field customization.

Return

Array of one PersonEvent object.

Security

Superuser, manager, self

POST /api/personevents/[event_id]

Description

Signs person on to course event.

Parameters

user_name

String. Optional. Username for user to be signed on.

representing_organisation_id

Int. Optional. Snapper Grape organisation_id which defines the organisation the person signed on to the course is representing. You cannot specify both context_organisation_id and  context_extern_organisation_id at the same time. This will result in an error message. 

representing_extern_organisation_id

Int. Optional. Snapper Grape external organisation_id which defines the organisation the person signed on to the course is representing. You cannot specify both context_organisation_id and  context_extern_organisation_id at the same time. This will result in an error message. 

order_id

Int. Optional. ID of order to add this sign on to. Only valid if order system is enabled.

order_reference

String. Optional. Order reference for new order that is created. Only valid if order system is enabled. Ignored if parameter order_id is given.

debitor_person_id

Int. Optional. Specify which person id that should be defined as debitor for the course sign on order.

debitor_extern_person_id

String. Optional. Same as above, but user is specified by the external id instead.

debitor_organisation_id

Int. Optional. Specify which organisation that should be defined as debitor for the course sign on order.

debitor_extern_organisation_id

String. Optional. Same as above, but debitor organisation specified using the external id.

contact_person_id

Int. Optional. Specify which person id that should be defined as contact person for the course sign on order.

contact_extern_person_id

String. Optional. Same as above, but user is specified by the external id instead.

contact_organisation_id

Int. Optional. Specify which organisation that should be defined as contact for the course sign on order.

contact_extern_organisation_id

String. Optional. Same as above, but contact organisation specified using the external id.

fields

String. Optional. See Field customization.

Return

Array of one PersonEvent object.

Security

Superuser, manager, self

PUT /api/personevents/[event_id]

Description

Signs person off course event. Or otherwise alters the sign on data (not specified or implemented yet).

Parameters

user_name

String. Username for user.

action

String. ”off”/”update”. Action to take. ”off” signs person off event.

fields

String. Optional. See Field customization.

Return

Array of one PersonEvent object.

Security

Superuser, manager, self