Salesforce Certified Slack Developer free question 5 / 10 · Domain 3: Designing Workflows Using Slack APIs
A file is uploaded to a channel that two authorized users of the app can see. The app must reach both users. How many events does the app receive, and how does it find the second user?
- One event arrives, and apps.event.authorizations.list returns the authorizations
- One event arrives, and auth.test lists the installations that can see it
- One event arrives, and the second user appears in the event_context field
- Two events arrive, one per user, with the user ID in the authorizations array field
Show the answer and explanation
Answer: A
Why this is correct
When several users in one workspace have installed the app and can see the same event, Slack sends one event and includes one user in the authorizations.user_id field. The event_context value can be used with the apps.event.authorizations.list method to obtain the full list of installations for which the event is visible. An app that needs to act for every authorized user should call that method rather than expecting one delivery per user. The documentation states: “If multiple users on one workspace have installed your app and can "see" the same event, we will send one event and include one user to whom this event is "visible" in the authorizations.user_id field.”
Why the other options are wrong
"Two events arrive, one per user, with the user ID in the authorizations array field" … Slack sends a single event for data visible to multiple users in a workspace, not one event per user.
"One event arrives, and the second user appears in the event_context field" … The event_context identifier is used with apps.event.authorizations.list to obtain installations. It does not hold a second user.
"One event arrives, and auth.test lists the installations that can see it" … auth.test checks the token it is called with. Listing the installations that can see an event is done with apps.event.authorizations.list.
Key points
One event per piece of data. Use apps.event.authorizations.list for the full set of authorizations.