# Slack

### Quote Alerting Example (with Slack)

In this example, we are going to **build an alert anytime a new quote is emitted**. To create this workflow, we are using:

1. Swallow's webhook when a new quote is emitted;
2. Slack as the "receiver" to alert your team anytime a new quote is created.

### 1. Create a Slack App

1. Go to the Slack API website (<https://api.slack.com/apps>) and click "Create New App".
2. Choose "From scratch" and give your app a name and select your workspace.
3. Once created, go to "OAuth & Permissions" in the sidebar.
4. Scroll down to "Scopes" and add the following Bot Token Scopes:
   * `chat:write`
   * `incoming-webhook`
5. At the top of the page, click "Install to Workspace" and authorize the app.

### 2. Set up Incoming Webhooks

1. In your Slack App settings, go to "Incoming Webhooks" in the sidebar.
2. Toggle "Activate Incoming Webhooks" to On.
3. Click "Add New Webhook to Workspace".
4. Choose the channel where you want to receive alerts and click "Allow".
5. Copy the Webhook URL that is generated.

### 3. Configure Swallow Webhook

<figure><img src="https://1110149073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu89vYHjuY9Vj4vhZX5IZ%2Fuploads%2FdnF4DVBAZVnfIC5ZKX8K%2Fimage.png?alt=media&#x26;token=da7b4819-9874-4dcc-b95b-b5a49c6246b0" alt=""><figcaption></figcaption></figure>

1. In Swallow, navigate to **Settings** then **Webhooks** > **Add a webhook**.
2. Paste the Slack Webhook URL you copied earlier.
3. Save the webhook configuration.

### 4. Test the Integration

1. In Swallow, create a new quote or trigger an action that would normally create a quote.
2. Check the specified Slack channel. You should see a message with the quote details.

### 5. Customize the Message (Optional)

If you want to customize the message format, you may need to use an intermediary service like Zapier or write a small application to receive the webhook from Swallow, format the message, and then send it to Slack.

Here's an example of what the Slack message might look like:

```
New Quote Created!
Quote reference: {quote_reference}
Total Amount: ${total_amount}
Due Date: {due_date}
```

By following these steps, you'll have set up a direct integration between Swallow and Slack, allowing your team to receive immediate notifications when new quotes are created.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://swallow-1.gitbook.io/swallow/integrations/alerting/slack.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
