Teams Teams: Incoming Webhooks

Summary

This module contains actions for sending messages & approval requests to a Teams channel.

Before you Start

Ensure you have enabled incoming webhooks on at least one Teams channel.

See the Integration page for more information

Actions

teams.incoming_webhooks.

send_approval_request

Send an approval request to a Teams channel & wait until it approved/rejected.

Once the request is responded to, a message will be posted to Teams containing the following:

  • Whether the request was approved or rejected
  • The username of the person who responded to the request

Example screenshots of all the Teams messages can be found under the example.

Teams Channel

The message will be sent to the channel associated with the supplied webhook URL.

Input
  • url: the Teams incoming webhook URL

  • message: a message to include in the approval request

Output

A dictionary with the following keys:

  • approved: true if the request was approved, false if it was not

  • responder: the PPA user who submitted the response

Example
1
2
3
4
5
- teams.incoming_webhooks.send_approval_request:
    message: Add user to Remote Desktop Users group.
  load:
    url: teams_secrets.webhook_url
  save: approval_response
Approval Request Screenshot

approval-request

Approved Message Screenshot

requested-approved

Rejected Message Screenshot

request-rejected

Supplying Sensitive Data

You should always use a PPA Vault integration to provide sensitive data to a plugin action.

teams.incoming_webhooks.

send_message

Send a message to a Teams channel.

Teams Channel

The message will be send to the channel associated with the supplied webhook URL.

Input
  • url: the Teams incoming webhook URL

  • message: the message to send to the channel

Output

Nothing is outputted by this action.

Example
1
2
3
4
- teams.incoming_webhooks.send_message:
    message: Hello from PPA!
  load:
    url: teams_secrets.webhook_url

Supplying Sensitive Data

You should always use a PPA Vault integration to provide sensitive data to a plugin action.