# Teams Webhooks

## Microsoft Teams Setup and Integration

To send rich formatted alerts to your Microsoft Teams platform, follow the instructions below:

**(1)** From the Teams main screen, go to applications and search for incoming webhooks. Click Add to a team.

<figure><img src="https://4290574019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LO5CAzpxoaEquZJBpYz%2Fuploads%2FRzHmNkySHCngl6dmPNjU%2FTeams_6XMb4pKucb.png?alt=media&#x26;token=943cd621-b0ad-40ba-a76c-91b7f3b88092" alt=""><figcaption></figcaption></figure>

OR click ... on an existing channel and choose "Connectors".

<figure><img src="https://4290574019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LO5CAzpxoaEquZJBpYz%2Fuploads%2FazFbbrjzKudUUW7Kn0nm%2FTeams_Xbh6I75G5F.png?alt=media&#x26;token=a6a93dd5-138f-4eff-85ff-b28b87ee0540" alt=""><figcaption></figcaption></figure>

**(2)** Give it a name and click "Create".

![Copy the Webhook URL](https://4290574019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LO5CAzpxoaEquZJBpYz%2Fuploads%2FY7lSDF7s4cKZcnlVbJ5D%2FTeams_RDMrlduImT.png?alt=media\&token=a48c2fa9-816c-4505-a676-a96fc4ca6226)

**(3)** Click the copy button next to the URL

<figure><img src="https://4290574019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LO5CAzpxoaEquZJBpYz%2Fuploads%2F3qoimWkyRbzWvYYjnbV9%2FTeams_AQDklG5nxb.png?alt=media&#x26;token=1f82e94c-637d-484a-afa5-9b2f701a0855" alt=""><figcaption></figcaption></figure>

**(4)** Login to the Keeper Admin Console and visit Reporting & Alerts > Alerts and click on an existing alert or create a new one.

<figure><img src="https://4290574019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LO5CAzpxoaEquZJBpYz%2Fuploads%2FW4Bd3lguB0Eoj4mvkLDL%2Fimage.png?alt=media&#x26;token=fda1488b-d857-4ccf-a021-a6856380b110" alt=""><figcaption><p>Add Alert</p></figcaption></figure>

**(5)** Select **Recipients** > **Add Recipients**&#x20;

<figure><img src="https://4290574019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LO5CAzpxoaEquZJBpYz%2Fuploads%2FawC1KW2o14hAIizltucw%2Fimage.png?alt=media&#x26;token=9ed17cda-7c12-4e6c-9e88-af247db5145b" alt=""><figcaption><p>Add Recipient (Teams)</p></figcaption></figure>

**(6)** Type in the Recipient Name and email address and click Add Webhook.

<figure><img src="https://4290574019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LO5CAzpxoaEquZJBpYz%2Fuploads%2FHvUIVOc3FoyIn72FtNPx%2Fimage.png?alt=media&#x26;token=45a12bb1-f22a-4f99-832a-858a4006ecf0" alt=""><figcaption><p>Add Webhook</p></figcaption></figure>

**(7)** Paste the Webhook URL from **Step 3** and then copy and paste the content for the HTTP body below.

<figure><img src="https://4290574019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LO5CAzpxoaEquZJBpYz%2Fuploads%2FvfA5oIYFt1VE9WwkJf2y%2Fimage.png?alt=media&#x26;token=6dfee334-0f18-49eb-adbd-780779c60791" alt=""><figcaption><p>Add URL and HTTP Body</p></figcaption></figure>

**(8)** Copy this JSON content and paste it into the **HTTP Body** section in the screenshot above.

```
{
    "@type": "MessageCard",
    "@context": "http://schema.org/extensions",
    "themeColor": "0076D7",
    "summary": "Alert: #alert_name",
    "sections": [{
        "activityTitle": "#description",
        "activitySubtitle": "#alert_name",
        "activityImage": "https://keeper-email-images.s3.amazonaws.com/common/Keeper_512x512.png",
        "facts": [{
            "name": "User",
            "value": "#username"
        }, {
            "name": "Timestamp",
            "value": "#timestamp"
        }, {
            "name": "IP Address",
            "value": "#remote_address"
        }],
        "markdown": true
    }]
}
```

**(10)** Click **Save** on the recipient and click **Save** on the alert.

<figure><img src="https://4290574019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LO5CAzpxoaEquZJBpYz%2Fuploads%2FFLtgwE79qdmuOgTYeEi6%2Fimage.png?alt=media&#x26;token=9b7a95db-bd6d-4233-a4e2-ea29a97ca567" alt="" width="375"><figcaption><p>Add Webhook</p></figcaption></figure>

<figure><img src="https://4290574019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LO5CAzpxoaEquZJBpYz%2Fuploads%2F3Siz0oJmhJm8NRpP1vgl%2Fimage.png?alt=media&#x26;token=de0606ce-55c9-46e3-bc97-4d56e3c04ec8" alt=""><figcaption></figcaption></figure>

That's it.  Please note that it can take up to 15 minutes for events to start transmitting. You can modify the HTTP Body according to your preferences.  See the [Microsoft Connectors website](https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using) to customize the look and feel completely.

{% hint style="info" %}
Creating new Webhook body content and editing content may take up to 15 minutes to take effect.
{% endhint %}

## (Optional) Testing Webhooks from the Command Line

For Mac / Linux users, a quick way to test your format is to use curl:

* Put the Webhook content into a test file such as test.json
* Run the Curl command with the following syntax, replacing URL with your Slack or Teams URL

```
# On Mac and Linux:
curl -X POST -H 'Content-type: application/json' -d @test.json <WEBHOOK URL>

# On Windows
curl.exe -H "Content-Type:application/json" -d @test.json <WEBHOOK URL>
```
