Trivia Slack App
Number of APIs: 3
Play A Trivia Game Using Slack and a Qodex Collection
What does this collection do?
This allows a user to play a trivia game inside Slack.
Prerequisites:
- You need to Create a Qodex Webhook that will invoke our Collection. Documentation for doing so is here
- You need to create a Slack Incoming Webhook (https://api.slack.com/incoming-webhooks). Fill the value of the URL of the generated Webhook in the variable
slackIncomingWebhookUrl
in Qodex. - You need to create a Slack Slash Command (https://api.slack.com/slash-commands). The URL that the slash command will POST to will be the URL of the Webhook you generated in Step 1.
- Turn on Interactive Components in the Slack App you created in Step 2.(https://api.slack.com/docs/message-buttons). This helps us process the user's input such as when he presses a button or chooses an option in a slack message.
- Make Sure that the webhook you create is in the Same environment as that of our collection.
Workflow:

The Final Application in Action:

-
Get Trivia Question GET https://opentdb.com/api.php?amount=10&category={{categoryCode}}&encode=base64
-
Send Question To Slack POST {{slackIncomingWebhookUrl}}
-
Check Answer and Send Result to Slack POST {{responseUrlToSlack}}