Last updated
Was this helpful?
Last updated
Was this helpful?
This documentation references external sources.
Nexthink does not control the accuracy of third-party documentation or external updates that can result in inconsistencies.
Report any errors or inconsistencies to .
This document demonstrates how to post a message to an MS Teams channel using a webhook.
After creating a new MS Teams channel, configure a new workflow using Microsoft Power Automate.
Click three dots on the created channel and select Workflows.
From the pop-up, search for and choose Post to a channel when a webhook request is received option. See the image below.
Name the workflow and define the workflow connection.
Define the Team channel (from MS Teams) to notify using the Nexthink webhook.
Select the Add Workflow button to create the new workflow.
URL example: https://xxxxx.your-instance.logic.azure.com:443/workflows/XXXXXXXXXXXXX/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=yhejWbe6e03M9-cvU-hXXXXXXXXXXXXX
Select Manage your Workflow:
Ensure the output format is set to attachments
Ensure the Adaptive card is defined as content.
For private Team channels, use the dropdowns to set Post as: User. Otherwise, you can select Fow Bot.
You must decode the URL from the Power Automator before pasting it in the webhook configuration in Nexthink.
Follow the steps below in Microsoft Entra ID:
Go to your Entra ID instance and register a new Application.
Manage > App registrations > New registration
Name the application and define the supported account type.
Click on the new Client secret and define the experience date.
You can only copy the secret value after created.
Navigate to the API permission tab and add the Access Microsoft Flow as signed in user permission.
Navigate back to overview of the just registered app and navigate to the to Endpoints tab.
From the Nexthink web interface:
Configure a connector credential for the outgoing webhook to MS Team
Choose the HTTPS option from the Protocol drop-down.
Choose No Auth (None) option from the Authorization drop-down.
Save the credential.
Choose the HTTPS option from the Protocol drop-down.
Choose OAuth 2.0 - Client Credentials option from the Authorization drop-down.
Save the credential.
Select the POST from the Method drop-down.
Make sure the URL is not encoded.
Add the message you want to send in Payload. See the example below.
Send Test to make sure the message is pushed into MS Teams.
Copy the URL for future reference for future reference. That is, for the and in the Nexthink web interface. See the image below.
Jump to the section if you do not require authentication OAuth 2.0 for the connector credentials.
Register the application and copy the application ID for future reference when in Nexthink.
Copy the secret value (not the ID) for future reference when in Nexthink.
Save the OAuth 2.0 token endpoint (v2) for future reference when in Nexthink.
From the configuration page, fill out the fields using the information from the configured incoming webhook in MS Teams:
Paste the root https://xxxxx.your-instance.logic.azure.com:443
into the URL address field from URL from .
From the configuration page, fill out the fields using the information from the configured incoming webhook in MS Teams:
Paste the root https://xxxxx.your-instance.logic.azure.com:443
into the URL address field from URL from .
Enter the Access token URL, Client ID and Client secret using the values from the
From the , fill out the fields using the information from the connection you created in MS Teams and the connector credential defined in Nexthink:
Fill in the NQL Condition following the documentation. See query below.
After filling in the NQL Condition, the system lists the for the Payload.
Choose the configured connector credential for MS Team (depending on the case, or from the Credentials drop-down.
Paste into the Resources field, the URL endpoint from the without the root URL address. For example: /workflows/XXXXXXXXXXXXXXXXXXX/triggers/manual/paths/invoke?api-version=?????&sp=/triggers/manual/run&sv=1.0&sig=XXXXXXXXXXXXXXX
Notice that the payload example below uses .