Adding Participants to Sessions

This step shows the method to add one or more users as participants in a session with PerculusAPI.

Before you can add a user as a participant in a session, you will need the USER_ID data of that user and the SESSION_ID data of that specific session.

Available parameters:

ParameterTypeDescription

user_id

string

role

string

a=Admin, u=User, e=Instructor, If not set, inherited from the user role directly.

Example Payload:

curl --location --request POST \
'https://<DOMAIN>/xapi/session/<SESSION_ID>/attendees' \
--header 'Authorization: Bearer <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '[{
    "user_id": "<USER_ID>",
    "role": "u"
}]'

Example Response:

{
    "approved": [
        {
            "session_id": "<SESSION_ID>",
            "user_id": "<USER_ID>",
            "attendee_id": "***",
            ,
            "name": "john",
            "surname": "Doe",
            "email": "john@doe.com",
            "role": "u",
            "mobile": "",
            "avatar": null,
            "creation_date": "2024-08-16T01:55:15.7991084Z",
            "updating_date": null
        }
    ],
    "rejected": []
}

You will need to work with the 'ATTENDANCE_CODE' data in the example response you see above if you are making an edit to the settings of a participant in that session. You must therefore store this data securely.

🔴 You will see two objects as approved and rejected in the response, you can see their details below:

  • approved:

    • Lists the records successfully added from the users.

  • rejected:

    • Lists the records that cannot be added from users.

Example Response:

{
    "approved": [],
    "rejected": [
        {
            "model": null,
            "state": {
                "code": 10,
                "details": "Object reference not set to an instance of an object."
            }
        }
    ]
}

Last updated