diff --git a/code-samples/eventing/bookstore-sample-app/create-workspace.md b/code-samples/eventing/bookstore-sample-app/create-workspace.md new file mode 100644 index 0000000000..5027b8df32 --- /dev/null +++ b/code-samples/eventing/bookstore-sample-app/create-workspace.md @@ -0,0 +1,36 @@ +# Notification Service: Creating a Slack Workspace + +## Create a Slack Workspace + +To create a Slack workspace, follow these steps: + +- Visit [https://slack.com/get-started#/createnew](https://slack.com/get-started#/createnew). +- Enter your email address and click Continue, or continue with Apple or Google. +- Check your email for a confirmation code. +- Enter the code on the Slack website. +- Click "Create a Workspace" and follow the prompts. +- For detailed instructions for androids and , refer to [Create a workspace](https://slack.com/help/articles/206845317-Create-a-Slack-workspace). + +## Adding Channels to Your Workspace + +After creating your Slack workspace, you can add channels by following these steps: + +- Click the '+' icon next to 'Channels' on the sidebar of your Slack workspace. +- Choose "Create a channel" and specify the channel name and purpose. +- For enterprise grid organizations, refer to [Slack's help article](https://slack.com/help/articles/115001399587-Add-a-channel-to-multiple-workspaces-in-your-Enterprise-Grid-organization) for instructions. + +## Setting Up a Webhook for Notifications + +To set up a webhook for sending notifications to your Slack workspace: + +- Create a [Slack app](https://api.slack.com/apps/new), following the instructions by signing in, adding name and workspace to put the app in. +- After this, you'll be redirected to the setting pages of your new app. Choose **Incoming Webhook** and toggle **Activate Webhook**. +- Scroll down to click the option **Add New Webhook to Workspace**. + ![Alt text](./screenshots/select-channel.png) +- The page will give you a link associated with the app you created. This link will be where API requests are sent to send messages to your Slack workspace. + ![Alt text](./screenshots/webhooklink.png) +- To test if the webhook works as needed, you can try sending an API request to this link to see if the message goes through. I used Postman to test this. Remember that this is an application/json file. + ![Alt text](./screenshots/Postman.png) +- Afterwards, the text channel should have a new message + ![Alt text](./screenshots/result.png) +- Go to [Slack's webhook documentation](https://api.slack.com/messaging/webhooks) to learn more about setting up webhooks. diff --git a/code-samples/eventing/bookstore-sample-app/screenshots/Postman.png b/code-samples/eventing/bookstore-sample-app/screenshots/Postman.png new file mode 100644 index 0000000000..126c3d4f45 Binary files /dev/null and b/code-samples/eventing/bookstore-sample-app/screenshots/Postman.png differ diff --git a/code-samples/eventing/bookstore-sample-app/screenshots/result.png b/code-samples/eventing/bookstore-sample-app/screenshots/result.png new file mode 100644 index 0000000000..58165e2693 Binary files /dev/null and b/code-samples/eventing/bookstore-sample-app/screenshots/result.png differ diff --git a/code-samples/eventing/bookstore-sample-app/screenshots/select-channel.png b/code-samples/eventing/bookstore-sample-app/screenshots/select-channel.png new file mode 100644 index 0000000000..472e1c330d Binary files /dev/null and b/code-samples/eventing/bookstore-sample-app/screenshots/select-channel.png differ diff --git a/code-samples/eventing/bookstore-sample-app/screenshots/webhooklink.png b/code-samples/eventing/bookstore-sample-app/screenshots/webhooklink.png new file mode 100644 index 0000000000..f5d66800c1 Binary files /dev/null and b/code-samples/eventing/bookstore-sample-app/screenshots/webhooklink.png differ