Chat services (Discord, Teams, Matrix)
Send AffFast messages to Discord, Microsoft Teams or Matrix with a Shoutrrr notification channel.
These services use the type shoutrrr of the notification channels. Select the service in the form. AffFast builds the Shoutrrr URL from the fields. The channel sends plain text.
Each section has the fields, an example and the common mistakes. Read services of GET /v1/notification_channel_types for the same fields in the API.
Discord
URL format that AffFast builds: discord://TOKEN@WEBHOOK_ID
| Field | Where | Required | Meaning |
|---|---|---|---|
webhook_id | config | Yes | The number before the token in the webhook URL. |
thread_id | config | No | The ID of a thread. Leave it empty to post to the channel. |
token | credentials | Yes | The long text after the webhook ID in the webhook URL. |
Set up Discord
- In Discord, open the settings of the channel. Select Integrations, then Webhooks, then New Webhook.
- Select Copy Webhook URL. It looks like
https://discord.com/api/webhooks/WEBHOOK_ID/TOKEN. - Copy the number after webhooks/ into the field Webhook ID. Copy the long text after it into the field Webhook token.
Example
curl -X POST https://api.afffast.com/v1/notification_channels \
-H "Authorization: Bearer $AFFFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "shoutrrr",
"label": "Team Discord",
"config": { "service": "discord", "webhook_id": "123456789012345678" },
"credentials": { "token": "abcDEF123..." }
}'Common mistakes in Discord
- The webhook ID has letters. Copy only the number between webhooks/ and the next slash.
- Someone deleted the webhook in Discord. Make a new webhook and save its values.
- A forum channel needs a thread. Enter a Thread ID.
Microsoft Teams
AffFast uses a Power Automate workflow. Microsoft retired the old Office 365 connectors (webhook.office.com).
URL format that AffFast builds: teams://?host=WORKFLOW_URL (the workflow URL is encoded with percent signs)
| Field | Where | Required | Meaning |
|---|---|---|---|
workflow_url | credentials | Yes | The address of the workflow trigger "When a Teams webhook request is received". |
Set up Microsoft Teams
- In Power Automate, make a workflow with the trigger When a Teams webhook request is received.
- Add the action that posts the message to your Teams channel.
- Save the workflow. Copy the URL of the trigger into the field Workflow URL.
The host of the workflow URL must end in .environment.api.powerplatform.com, .logic.azure.com, .logic.azure.us or .logic.azure.cn.
Example
{
"type": "shoutrrr",
"label": "Team channel",
"config": { "service": "teams" },
"credentials": {
"workflow_url": "https://prod-01.westeurope.logic.azure.com:443/workflows/.../triggers/manual/paths/invoke?api-version=2016-06-01&sp=...&sv=1.0&sig=..."
}
}Common mistakes in Microsoft Teams
- The URL is an old Office 365 connector address (webhook.office.com). Microsoft retired these. Use a Power Automate workflow.
- The workflow URL has no sig= part. Copy the whole URL again.
- The workflow needs a sign-in. Make a workflow that anyone with the URL can start.
Matrix
URL format that AffFast builds: matrix://USER:PASSWORD@HOST/?rooms=ROOM1,ROOM2
| Field | Where | Required | Meaning |
|---|---|---|---|
host | config | Yes | The host of the homeserver, for example matrix.example.com. |
user | config | No | The user name. Leave it empty when you use an access token. |
rooms | config | Yes | A list of room IDs or room aliases, for example !abc:example.com. |
token | credentials | Yes | The password of the user. Without a user, the access token of the account. |
Set up Matrix
- Make a user for AffFast on your homeserver and add it to the room.
- Enter the host of the homeserver, the user and the password. Or leave the user empty and enter an access token.
- Enter the room IDs or the room aliases, one for each item of the list.
Example
{
"type": "shoutrrr",
"label": "Matrix alerts",
"config": {
"service": "matrix",
"host": "matrix.example.com",
"user": "affbot",
"rooms": ["!abc123:example.com"]
},
"credentials": { "token": "the password of the user" }
}Common mistakes in Matrix
- The homeserver has no password login. Leave the user empty and use an access token.
- The user is not in the room. Invite the user, or use the room ID so that AffFast can join.