{"id":61525,"date":"2024-03-13T11:33:51","date_gmt":"2024-03-13T11:33:51","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-1\/?p=61525"},"modified":"2024-04-17T11:02:37","modified_gmt":"2024-04-17T10:02:37","slug":"how-to-trigger-a-proactive-notification-in-microsoft-teams","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/kb\/how-to-trigger-a-proactive-notification-in-microsoft-teams\/","title":{"rendered":"Using Proactive Notifications API with a Payload to Present Interactive Elements in MS Teams"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p><span style=\"font-weight: 400;\">Proactive Notifications allow enterprises to engage with their end users (customers or employees) by providing relevant and timely updates. Developers can add additional details or actions in the API payload that they want to present to the users as part of the notification. For example, for the MS Teams channel, the notification can include a link\/button that the end-users can click.<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Sample_API_Payload_for_MS_Teams\"><span style=\"font-weight: 400;\">Sample API Payload for MS Teams<\/span><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Below is a sample API payload with a <\/span><b>message<\/b><span style=\"font-weight: 400;\"> component containing the notification&#8217;s content, formatted for Microsoft Teams.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><b>message<\/b><span style=\"font-weight: 400;\"> component includes the following details:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>type<\/b><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">script<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>val<\/b><span style=\"font-weight: 400;\">: A stringified JSON object representing an Adaptive Card for MS Teams. This card includes:<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">An image from a URL (a company logo, for instance).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Text blocks for status, description, total value, and creation date of a ticket or project.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">An action set with a submit action allowing the recipient to interact with the card, such as reopening a ticket with a specific number.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4><span style=\"font-weight: 400;\">Sample API Request<\/span><\/h4>\n<p><code>curl --location 'https:\/\/bots.kore.ai\/api\/public\/bot\/{{BotID}}\/notify' \\<br \/>\n--header 'Content-Type: application\/json' \\<br \/>\n--header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \\<br \/>\n--data-raw '{<br \/>\n\"channel\": \"msteams\",<br \/>\n\"userIdentityType\": \"resolve\",<br \/>\n\"message\": {<br \/>\n\"type\": \"script\",<br \/>\n\"val\": \"{\\\"type\\\":\\\"message\\\",\\\"speak\\\":\\\"\\\",\\\"attachments\\\":[{\\\"contentType\\\":\\\"application\/vnd.microsoft.card.adaptive\\\",\\\"content\\\":{\\\"$schema\\\":\\\"http:\/\/adaptivecards.io\/schemas\/adaptive-card.json\\\",\\\"type\\\":\\\"AdaptiveCard\\\",\\\"version\\\":\\\"1.4\\\",\\\"body\\\":[{\\\"type\\\":\\\"ColumnSet\\\",\\\"id\\\":\\\"idx0\\\",\\\"columns\\\":[{\\\"type\\\":\\\"Column\\\",\\\"items\\\":[{\\\"type\\\":\\\"Image\\\",\\\"style\\\":\\\"Person\\\",\\\"url\\\":\\\"https:\/\/lever-client-logos.s3.amazonaws.com\/965b74f1-3802-484a-9511-459bbdaccb55-1572990729555.png\\\",\\\"size\\\":\\\"Medium\\\"}],\\\"width\\\":\\\"auto\\\"},{\\\"type\\\":\\\"Column\\\",\\\"items\\\":[{\\\"type\\\":\\\"TextBlock\\\",\\\"text\\\":\\\"Status: **Closed**\\\",\\\"spacing\\\":\\\"small\\\",\\\"wrap\\\":true},{\\\"type\\\":\\\"TextBlock\\\",\\\"text\\\":\\\"Description: GDC Sow for developmet for Golden Fortress\\\",\\\"spacing\\\":\\\"Small\\\",\\\"separator\\\":true,\\\"wrap\\\":true},{\\\"type\\\":\\\"TextBlock\\\",\\\"spacing\\\":\\\"small\\\",\\\"text\\\":\\\"Total Value: 33615.00\\\",\\\"wrap\\\":true},{\\\"type\\\":\\\"TextBlock\\\",\\\"spacing\\\":\\\"small\\\",\\\"text\\\":\\\"Creation Date: 2021-08-15T16:24:17-07:0\\\",\\\"wrap\\\":true}],\\\"width\\\":\\\"stretch\\\"},{\\\"type\\\":\\\"Column\\\",\\\"items\\\":[{\\\"type\\\":\\\"ActionSet\\\",\\\"actions\\\":[{\\\"type\\\":\\\"Action.Submit\\\",\\\"title\\\":\\\"1190148660\\\",\\\"data\\\":{\\\"msteams\\\":{\\\"type\\\":\\\"imBack\\\",\\\"value\\\":\\\"Reopen ticket number INC03004614\\\"}}}],\\\"spacing\\\":\\\"None\\\",\\\"horizontalAlignment\\\":\\\"Right\\\",\\\"separator\\\":true}],\\\"width\\\":\\\"auto\\\",\\\"spacing\\\":\\\"Small\\\"}],\\\"separator\\\":true,\\\"spacing\\\":\\\"Large\\\"},{\\\"type\\\":\\\"ColumnSet\\\",\\\"id\\\":\\\"idx0\\\",\\\"columns\\\":[{\\\"type\\\":\\\"Column\\\",\\\"items\\\":[{\\\"type\\\":\\\"Image\\\",\\\"style\\\":\\\"Person\\\",\\\"url\\\":\\\"https:\/\/lever-client-logos.s3.amazonaws.com\/965b74f1-3802-484a-9511-459bbdaccb55-1572990729555.png\\\",\\\"size\\\":\\\"Medium\\\"}],\\\"width\\\":\\\"auto\\\"},{\\\"type\\\":\\\"Column\\\",\\\"items\\\":[{\\\"type\\\":\\\"TextBlock\\\",\\\"text\\\":\\\"Status: **Closed**\\\",\\\"spacing\\\":\\\"small\\\",\\\"wrap\\\":true},{\\\"type\\\":\\\"TextBlock\\\",\\\"text\\\":\\\"Description: GDC Sow for developmet for Golden Fortress\\\",\\\"spacing\\\":\\\"Small\\\",\\\"separator\\\":true,\\\"wrap\\\":true},{\\\"type\\\":\\\"TextBlock\\\",\\\"spacing\\\":\\\"small\\\",\\\"text\\\":\\\"Total Value: 33615.00\\\",\\\"wrap\\\":true},{\\\"type\\\":\\\"TextBlock\\\",\\\"spacing\\\":\\\"small\\\",\\\"text\\\":\\\"Creation Date: 2021-08-15T16:24:17-07:0\\\",\\\"wrap\\\":true}],\\\"width\\\":\\\"stretch\\\"},{\\\"type\\\":\\\"Column\\\",\\\"items\\\":[{\\\"type\\\":\\\"ActionSet\\\",\\\"actions\\\":[{\\\"type\\\":\\\"Action.Submit\\\",\\\"title\\\":\\\"1190148660\\\",\\\"data\\\":{\\\"msteams\\\":{\\\"type\\\":\\\"imBack\\\",\\\"value\\\":\\\"Reopen ticket number INC03004614\\\"}}}],\\\"spacing\\\":\\\"None\\\",\\\"horizontalAlignment\\\":\\\"Right\\\",\\\"separator\\\":true}],\\\"width\\\":\\\"auto\\\",\\\"spacing\\\":\\\"Small\\\"}],\\\"separator\\\":true,\\\"spacing\\\":\\\"Large\\\"},{\\\"type\\\":\\\"ColumnSet\\\",\\\"id\\\":\\\"idx0\\\",\\\"columns\\\":[{\\\"type\\\":\\\"Column\\\",\\\"items\\\":[{\\\"type\\\":\\\"Image\\\",\\\"style\\\":\\\"Person\\\",\\\"url\\\":\\\"https:\/\/lever-client-logos.s3.amazonaws.com\/965b74f1-3802-484a-9511-459bbdaccb55-1572990729555.png\\\",\\\"size\\\":\\\"Medium\\\"}],\\\"width\\\":\\\"auto\\\"},{\\\"type\\\":\\\"Column\\\",\\\"items\\\":[{\\\"type\\\":\\\"TextBlock\\\",\\\"text\\\":\\\"Status: **Closed**\\\",\\\"spacing\\\":\\\"small\\\",\\\"wrap\\\":true},{\\\"type\\\":\\\"TextBlock\\\",\\\"text\\\":\\\"Description: GDC Sow for developmet for Golden Fortress\\\",\\\"spacing\\\":\\\"Small\\\",\\\"separator\\\":true,\\\"wrap\\\":true},{\\\"type\\\":\\\"TextBlock\\\",\\\"spacing\\\":\\\"small\\\",\\\"text\\\":\\\"Total Value: 33615.00\\\",\\\"wrap\\\":true},{\\\"type\\\":\\\"TextBlock\\\",\\\"spacing\\\":\\\"small\\\",\\\"text\\\":\\\"Creation Date: 2021-08-15T16:24:17-07:0\\\",\\\"wrap\\\":true}],\\\"width\\\":\\\"stretch\\\"},{\\\"type\\\":\\\"Column\\\",\\\"items\\\":[{\\\"type\\\":\\\"ActionSet\\\",\\\"actions\\\":[{\\\"type\\\":\\\"Action.Submit\\\",\\\"title\\\":\\\"1190148660\\\",\\\"data\\\":{\\\"msteams\\\":{\\\"type\\\":\\\"imBack\\\",\\\"value\\\":\\\"Reopen ticket number INC03004614\\\"}}}],\\\"spacing\\\":\\\"None\\\",\\\"horizontalAlignment\\\":\\\"Right\\\",\\\"separator\\\":true}],\\\"width\\\":\\\"auto\\\",\\\"spacing\\\":\\\"Small\\\"}],\\\"separator\\\":true,\\\"spacing\\\":\\\"Large\\\"},{\\\"type\\\":\\\"ColumnSet\\\",\\\"id\\\":\\\"idx0\\\",\\\"columns\\\":[{\\\"type\\\":\\\"Column\\\",\\\"items\\\":[{\\\"type\\\":\\\"Image\\\",\\\"style\\\":\\\"Person\\\",\\\"url\\\":\\\"https:\/\/lever-client-logos.s3.amazonaws.com\/965b74f1-3802-484a-9511-459bbdaccb55-1572990729555.png\\\",\\\"size\\\":\\\"Medium\\\"}],\\\"width\\\":\\\"auto\\\"},{\\\"type\\\":\\\"Column\\\",\\\"items\\\":[{\\\"type\\\":\\\"TextBlock\\\",\\\"text\\\":\\\"Status: **Closed**\\\",\\\"spacing\\\":\\\"small\\\",\\\"wrap\\\":true},{\\\"type\\\":\\\"TextBlock\\\",\\\"text\\\":\\\"Description: GDC Sow for developmet for Golden Fortress\\\",\\\"spacing\\\":\\\"Small\\\",\\\"separator\\\":true,\\\"wrap\\\":true},{\\\"type\\\":\\\"TextBlock\\\",\\\"spacing\\\":\\\"small\\\",\\\"text\\\":\\\"Total Value: 33615.00\\\",\\\"wrap\\\":true},{\\\"type\\\":\\\"TextBlock\\\",\\\"spacing\\\":\\\"small\\\",\\\"text\\\":\\\"Creation Date: 2021-08-15T16:24:17-07:0\\\",\\\"wrap\\\":true}],\\\"width\\\":\\\"stretch\\\"},{\\\"type\\\":\\\"Column\\\",\\\"items\\\":[{\\\"type\\\":\\\"ActionSet\\\",\\\"actions\\\":[{\\\"type\\\":\\\"Action.Submit\\\",\\\"title\\\":\\\"1190148660\\\",\\\"data\\\":{\\\"msteams\\\":{\\\"type\\\":\\\"imBack\\\",\\\"value\\\":\\\"Reopen ticket number INC03004614\\\"}}}],\\\"spacing\\\":\\\"None\\\",\\\"horizontalAlignment\\\":\\\"Right\\\",\\\"separator\\\":true}],\\\"width\\\":\\\"auto\\\",\\\"spacing\\\":\\\"Small\\\"}],\\\"separator\\\":true,\\\"spacing\\\":\\\"Large\\\"}]}}]}\"<br \/>\n},<br \/>\n\"identities\": [<br \/>\n\"praveen@koredotai.onmicrosoft.com\",<br \/>\n\"ravindranaik@koredotai.onmicrosoft.com\"<br \/>\n]<br \/>\n}'<br \/>\n<\/code><\/p>\n<h4>Sample Notification in Microsoft Teams<\/h4>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20240326060204\/image1-10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-61551 size-full\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20240326060204\/image1-10.png\" alt=\"\" width=\"1850\" height=\"1055\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20240326060204\/image1-10.png 1850w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20240326060204\/image1-10-300x171.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20240326060204\/image1-10-1024x584.png 1024w\" sizes=\"auto, (max-width: 1850px) 100vw, 1850px\" \/><\/a><\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<\/div><\/div><\/div><\/div><\/div><\/section><section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\"><div class=\"ult-spacer spacer-6ae884e61ca8f\" data-id=\"6ae884e61ca8f\" data-height=\"\" data-height-mobile=\"\" data-height-tab=\"\" data-height-tab-portrait=\"\" data-height-mobile-landscape=\"\" style=\"clear:both;display:block;\"><\/div><\/div><\/div><\/div><\/div><\/div><\/section><section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\"><div class=\"ult-spacer spacer-6ae884e61ccde\" data-id=\"6ae884e61ccde\" data-height=\"10\" data-height-mobile=\"10\" data-height-tab=\"10\" data-height-tab-portrait=\"\" data-height-mobile-landscape=\"\" style=\"clear:both;display:block;\"><\/div><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"Proactive Notifications allow enterprises to engage with their end users (customers or employees) by providing relevant and timely updates. Developers can add additional details or actions in the API payload that they want to present to the users as part of the notification. For example, for the MS Teams channel, the notification can include a...","protected":false},"author":33,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[205],"tags":[],"class_list":["post-61525","post","type-post","status-publish","format-standard","hentry","category-kb"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/61525","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/comments?post=61525"}],"version-history":[{"count":8,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/61525\/revisions"}],"predecessor-version":[{"id":61593,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/61525\/revisions\/61593"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=61525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=61525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=61525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}