Sessions

Sessions are created when a person starts a quiz. They are used to track the progress of the quiz and the score of the person.

Endpoints


get/api/v3/quiz/sessions

Return a paginated list of quiz/sessions

Input Schema

object
page?:
object
The page number, default to 1
number?: integer
The number of items per page, default to 1000
size?: integer
The sort order, comma separated list of fields. See sorting section for more details
sort?: string
Set to true to return the total number of items in the collection
count?: boolean
filter?:
object
id?: unknown
person_id?: unknown
created_at?: unknown
name?: unknown
status?: unknown
expires_at?: unknown
score?: unknown
name__match?: unknown
person_id?: unknown
The fields to include in the response.
The key is the resource type and the value is an array of fields.
fields?:
dictionary
Values: array

Typescript

type InputSchema = {
  page?: {
    // The page number, default to 1
    number?: number;
    // The number of items per page, default to 1000
    size?: number;
  };
  // The sort order, comma separated list of fields. See sorting section for more details
  sort?: string;
  // Set to true to return the total number of items in the collection
  count?: boolean;
  filter?: {
    id?: any;
    person_id?: any;
    created_at?: any;
    name?: any;
    status?: any;
    expires_at?: any;
    score?: any;
    name__match?: any;
    person_id?: any;
  };
  // The fields to include in the response.
  // The key is the resource type and the value is an array of fields.
  fields?: { [key: string]: Array<any> };
};

Output Schema

object
data:
array
Elements:
object
type: string
id?: string
attributes?:
object
id?: string
person_id?: integer
created_at?: datetime
name?: string
status?: string
expires_at?: datetime
score?: number
relationships?: open struct
included?:
array
Elements: open struct

Typescript

type OutputSchema = {
  data: Array<{
    type: string;
    id?: string;
    attributes?: {
      id?: string;
      person_id?: number;
      created_at?: Date;
      name?: string;
      status?: string;
      expires_at?: Date;
      score?: number;
    };
    relationships?: Record<string, any>;
  }>;
  included?: Array<Record<string, any>>;
};


post/api/v3/quiz/sessions

Create a new session for a quiz

Input Schema

object
data:
object
type: string
attributes:
object
person_id: integer
expires_at?: datetime

Typescript

type InputSchema = {
  data: { type: string; attributes: { person_id: number; expires_at?: Date } };
};


delete/api/v3/quiz/sessions/:resource_id

Delete the quiz/sessions

Input Schema

object
resource_id: string

Typescript

type InputSchema = { resource_id: string };


patch/api/v3/quiz/sessions/:resource_id

Update a quiz/sessions

Input Schema

object
resource_id: string
data:
object
type: string
attributes:
object
id?: string
person_id?: integer
created_at?: datetime
name?: string
status?: string
expires_at?: datetime
score?: number

Typescript

type InputSchema = {
  resource_id: string;
  data: {
    type: string;
    attributes: {
      id?: string;
      person_id?: number;
      created_at?: Date;
      name?: string;
      status?: string;
      expires_at?: Date;
      score?: number;
    };
  };
};


get/api/v3/quiz/sessions/:session_id

Show a specific session

Input Schema

object
session_id: string

Typescript

type InputSchema = { session_id: string };


patch/api/v3/quiz/sessions/:session_id

Update a session

Input Schema

object
session_id: string
data:
object
type: string
attributes:
object
expires_at?: datetime
name?: string

Typescript

type InputSchema = {
  session_id: string;
  data: { type: string; attributes: { expires_at?: Date; name?: string } };
};


patch/api/v3/quiz/sessions/:session_id/cancel

Cancel a session

Input Schema

object
session_id: string

Typescript

type InputSchema = { session_id: string };