Event Registration Integration
Scenario description
The following document describes the API integration flow for registering users to events, including necessary account setup and community access management.
Flow description
The guide assumes that the events are already created in knolyx and all the necessary configuration regarding community access and workgroups is already done.
- Check/Create User Account
- the API will check if the user does not have an account and creates it
- Nothing happens if the account already exists
- Ensure Community Access
- add the user to the appropriate workgroup for event access
- this will give the user access to the community and its events
- Register for Event
- mark the user as attending the event
- this will add the user to the event’s attendee list
1. Check/Create User Account
1.1 Provision user endpoint
POST /public/api/v1/user/provision
The endpoint allows creating and editing basic user information. If the user does not exist, the response status will be 201 (created) and an on-boarding email is sent to the user. If the user exists, the response status will be 200 OK, no email will be sent and the changed fields will be persisted.
Example body
{
"firstName": "Jon",
"lastName": "Doe",
"email": "jon.doe@knolyx.com",
"gender": "NON-BINARY"
}All fields besides gender are required. If gender is omitted, a default value of NON-BINARY is set. Gender values allowed: NON-BINARY | MALE | FEMALE.
2. Ensure Community Access
2.1 Add user to workgroup
PUT /public/api/v1/workgroup/{workgroupId}/member/{user-email}/
Body
{ "removalDate": "2024-05-04 14:30:00" }The removal date is the date when the user is removed from the workgroup (and by extension loses access to the community).
If no removal date is needed, the value should be null.
The removal date has the format yyyy-MM-dd HH:mm:ss and should be in UTC time.
If the request was successful then a status code of 200 will be returned and a json of format:
{
"email": "{user-email}"
}3. Register for Event
3.1 Mark user as attending
POST /public/api/v1/community/{communityId}/event/{eventId}/attend/{userId}
This endpoint marks the user as attending the event. The user must have access to the community (through workgroup membership) to be able to register for events.
If the request was successful, a status code of 200 will be returned.
3.2 Cancel attendance (if needed)
DELETE /public/api/v1/community/{communityId}/event/{eventId}/attend/{userId}
This endpoint cancels the user’s attendance for the event.
If the request was successful, a status code of 200 will be returned.
Required Permissions
To implement this integration, you’ll need an API key with the following permissions:
USER_PROVISION: For creating new user accountsWORKGROUP_ADD_MEMBER: For adding users to workgroupsEVENT_MANAGE: For managing event attendance
To create an API key with these permissions, see the getting started guide.
