GET /api/events

Description

Returns array of course events. Note that this will not return events that are modules of a parent course. These are nested in the children attribute of the object.

Parameters

view

String. Optional. Specifies either "full" or "simple" result type.

competence_id

Int. Optional. To list only events belonging to a specific competence.

organisation_ids

Array of ints. Optional. Only return events that have participants belonging to Organisations.

user_check

Int. Optional 1 or 0. If set to 1, Snapper Grape will check if current logged in user (or user defined with user_name) is signed on to the course.

recursive

Int. Optional. 1 or 0. Whether or not parameter organisation_ids should result in a recursive, tree search for participants or not. If set, will return events with participants belonging to branches of organisation tree defined by organisation_ids. Default: 0

term

String. Optional. Search term, to restrict results to events matching term.

cancelled

Int. Optional. Return cancelled events or not. Default: 0

category_ids

Array of ints. Optional. Restrict result to events whose definition (competence) is tagged with categories.

attribute_ids

Array of ints. Optional. Restrict result to events that are tagged with attributes.

competence_group_ids

Array of ints. Optional. Restrict result to events whose definition (competence) is tagged in groups.

location_id

Int. Optional. Return only events held at given location. Startdate and enddate must also be given, otherwise will be ignored.

start

Int. Optional. Index to start at.

limit

Int. Optional. Max length of result set.

mode

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

startdate

String, date on ISO format. Optional. Return only events starting on or after this time. Overrides ”mode” parameter.

enddate

String, date on ISO format. Optional. Return only events starting before this time. Overrides ”mode” parameter.

sort_direction

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

Return

Array of Event objects.

Security

Superuser, manager, person

GET /api/events/[event_id]

Description

Returns detailed view of course event.

Parameters

view

String. Optional. Specifies if you want either 'full' or 'simple' result type.

user_check

Int. Optional 1 or 0. If set to 1, Snapper Grape will check if current logged in user (or user defined with user_name) is signed on to the course. 

Return

Array of one Event object.

Security

Superuser, manager, person

GET /api/events/[event_id]/participants

Description

Returns a list of participants (Person) for the course event.

/api/participants/123 will yield the same result as /api/events/123/participants.

Parameters

view

String. Optional. Specifies if you want either 'full' or 'simple' result type.

Return

Array of Person objects.

Security

Superuser, manager, person