Skip to main content

Microsoft Teams with Geins Webhooks

This guide demonstrates how to set up a webhook to send a notification to a Microsoft Teams channel on various events an order can go through in Geins.

Introduction

Microsoft Teams is a popular messaging app for teams. It provides a platform for team communication and collaboration. Microsoft Teams also supports webhooks, which can be used to send notifications to a Teams channel. This can be useful for sending notifications about events in Geins, such as when an order is locked or when a new customer is created.

Setting up webhook for locked order

This example demonstrates how to set up a webhook that triggers on locked orders and sends a notification to a Microsoft Teams channel. The notification includes a button linking to the OMS for detailed order review.

  • Step 1: Configure the incoming webhook in teams. Please refer to the Teams documentation
  • Step 2: Set up the webhook to listen for lock actions on the Order entity.

cURL Example

Use cURL to create the webhook
curl -X POST "https://mgmtapi.geins.io/API/Webhook" `
-H "Content-Type: application/json" `
-H "X-Apikey: api-key" `
-u "user:password" `
-d '{
"Entity": "Order",
"Name": "Locked Order Notification",
"Description": "Notifies when an order is locked",
"Actions": "lock",
"Method": "POST",
"Url": "https://company.webhook.office.com/webhookb2/0000000-0000-0000-0000-000000000000/IncomingWebhook/0000000-0000-0000-0000-000000000000/0000000-0000-0000-0000-000000000000",
"Body": "{\"text\": \"Order Locked: {{id}}\", \"potentialAction\": [{\"@type\": \"OpenUri\", \"name\": \"View Order\", \"targets\": [{\"os\": \"default\", \"uri\": \"https://webshop.admin.geins.io/Admin/Order/Edit/{{id}}\"}]}]}",
"Headers": "Content-Type: application/json",
"Retry": true
}'