Page MenuHomePhabricator

Integrate Event Center with Programs & Events Dashboard
Open, Needs TriagePublic

Description

The existing Programs & Events (aka P&E) Dashboard is the tool that many organisers use for tracking impact in their events. In the P+E Dashboard, organisers already have the ability to add participants to an event. Since this will be a feature overlap with the Event Center, we would like to build an integration between the P+E dashboard and Event Center so participant list can be synchronised between the two platform.

Please see the diagram (drawn up by @cmelo based on discussions between the Campaigns engineers and @Ragesoss) below for the plan for MVP integration.

image1.png (824×1 px, 150 KB)

Note that this integration is considered out-of-scope for v0, so this will not be worked on until we start work for v1 (tentatively in June 2022).

Event Timeline

I've gone through more of working through the API details based on the discussions. Here's what I propose. (Assuming that every Event Center user has an account on Meta, the wiki language/project isn't necessary. If that's not the case, then we'll need to add the wiki details as params as well.)

Relatively to the diagram, this adds event_id and removes wiki_language_prefix and wiki_project_domain.

endpoint 1: confirm_event_sync

This one corresponds to the 'Create Event Registration' event, establishing that a particular Event Center event will be responsible for the participant list of a particular Dashboard Course.

POST /wikimedia_event_center/confirm_event_sync as JSON
{
 "course_slug": string // the unique URL slug for the Course
 "event_id": string or integer // a unique ID for the Event Center event
 "organizer_username": string // the username of the Event Center event's organizer.
                              // Must match a user in the "facilitator" role for the Course.
 "secret": string // shared secret between the Event Center and the Dashboard
}

On failure, returns a JSON object with the error message and error code.
Possible error codes:

invalid_secret - The shared secret doesn't match
course_not_found - A Course with the provided slug doesn't exist
not_organizer - The organizer username doesn't match a user in the "facilitator" role
already_in_use - The course already has participants, so it can't be linked to the event
sync_already_enabled - The course is already linked to an event

endpoint 2: update_event_participants

This is for any time users are added or removed from an event, to push the latest participant list to the Dashboard Course.

POST /wikimedia_event_center/update_event_participants as JSON
{
 "course_slug": string // the unique URL slug for the Course
 "event_id": string or integer // a unique ID for the Event Center event
 "organizer_username": string // the username of the Event Center event's organizer.
                              // Must match a user in the "facilitator" role for the Course.
 "secret": string // shared secret between the Event Center and the Dashboard
 "participant_usernames": array of strings // usernames of event's current participants
}

Possible error codes:

invalid_secret - The shared secret doesn't match
course_not_found - A Course with the provided slug doesn't exist
not_organizer - The organizer username doesn't match a user in the "facilitator" role
sync_not_enabled - This Course isn't linked to the Event Center event (based on event_id)

@cmelo please have look at my proposed API signatures when you have a chance. If these look good, I'm ready to implement them.

HI @Ragesoss, thanks for the detailed information, it sounds good for the MVP.

I've deployed this to a test server, dashboard-testing.wikiedu.org, and can provide the API secret whenever the team is ready to start testing out integration.