{"info":{"_postman_id":"51012a32-c9e7-41c4-8960-01635eb406a1","name":"OrderCloud+Teams Integration","description":"<html><head></head><body><p>This collection holds the APIs needed to initialize an OrderCloud instance for sending notifications to Microsoft Teams by creating the needed Webhooks &amp; API Client. The Webhooks invoke a Node.js Azure Function App(created from this Github repo, <a href=\"https://github.com/SubbuRamanathan/ordercloud-microsoft-teams-integration\">https://github.com/SubbuRamanathan/ordercloud-microsoft-teams-integration</a>), which prepares and sends the notification to the configured Teams Endpoint. The API Client created will be used by Azure Function to search Order Approvals, Inventory, Promotions, etc. in OrderCloud to send scheduled daily/weekly reminders to the configured Teams Endpoint.</p>\n<p>Contact Support:</p>\n<p>Name: Subramanian Ramanathan<br>Email: <a href=\"mailto:sramanathan@subramanian.ca\">sramanathan@subramanian.ca</a><br>Github: <a href=\"https://github.com/SubbuRamanathan/ordercloud-microsoft-teams-integration\">https://github.com/SubbuRamanathan/ordercloud-microsoft-teams-integration</a></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"20395702","collectionId":"51012a32-c9e7-41c4-8960-01635eb406a1","publishedId":"2s83KadMin","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2022-09-25T01:17:29.000Z"},"item":[{"name":"Api Client","item":[{"name":"Reminders Scheduler","event":[{"listen":"prerequest","script":{"id":"bc7066c3-b58d-4985-ac2b-6320a91885be","exec":[""],"type":"text/javascript"}}],"id":"406ba86a-1614-409f-9fcd-c3610bb72629","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"ClientSecret\": \"\",\r\n    \"AccessTokenDuration\": 10,\r\n    \"Active\": true,\r\n    \"AppName\": \"Reminders Scheduler - Azure Functions\",\r\n    \"RefreshTokenDuration\": 0,\r\n    \"DefaultContextUserName\": \"Default_Admin\",\r\n    \"xp\": null,\r\n    \"AllowAnyBuyer\": true,\r\n    \"AllowAnySupplier\": true,\r\n    \"AllowSeller\": true,\r\n    \"IsAnonBuyer\": false,\r\n    \"AssignedBuyerCount\": 0,\r\n    \"AssignedSupplierCount\": 0,\r\n    \"OrderCheckoutIntegrationEventID\": null,\r\n    \"OrderCheckoutIntegrationEventName\": null,\r\n    \"MinimumRequiredRoles\": [],\r\n    \"MinimumRequiredCustomRoles\": [],\r\n    \"MaximumGrantedRoles\": [],\r\n    \"MaximumGrantedCustomRoles\": []\r\n}","options":{"raw":{"language":"json"}}},"url":"https://sandboxapi.ordercloud.io/v1/apiclients","description":"<p>Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an admin user is created, updated, or deleted.</p>\n","urlObject":{"path":["v1","apiclients"],"host":["https://sandboxapi.ordercloud.io"],"query":[],"variable":[]}},"response":[],"_postman_id":"406ba86a-1614-409f-9fcd-c3610bb72629"}],"id":"4ba13267-6754-4e05-a788-1e4cf88ab206","_postman_id":"4ba13267-6754-4e05-a788-1e4cf88ab206","description":""},{"name":"Webhooks","item":[{"name":"Teams Notification for Admin Users","event":[{"listen":"prerequest","script":{"id":"30a22896-db6e-4c92-a346-f25ce56b2b51","exec":[""],"type":"text/javascript"}}],"id":"dcc1c7da-a6c1-44ad-83d3-4d445650a371","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"ID\": \"yLGf5IEviESxpvYpKmFnxw\",\r\n    \"Name\": \"Teams Notification for Admin Users\",\r\n    \"Description\": \"Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an admin user is created, updated, or deleted.\",\r\n    \"Url\": \"https://ordercloudfunctions.azurewebsites.net/api/updatenotifications-httptrigger?code=\",\r\n    \"HashKey\": \"\",\r\n    \"ElevatedRoles\": null,\r\n    \"ConfigData\": {\r\n        \"webhook\": \"\",\r\n        \"template\": \"default\",\r\n        \"title\": \"An Admin User('${FirstName} ${LastName}') has been ${status}\",\r\n        \"subtitle\": \"You can perform any action using the link(s) below\",\r\n        \"facts\": \"Username|ID|Email|Active\",\r\n        \"actions\": \"{\\\"View/Edit User\\\":\\\"http://seller.headstart.localhost/seller-admin/users/${ID}\\\",\\\"View All Users\\\":\\\"http://seller.headstart.localhost/seller-admin/users\\\"}\",\r\n        \"image\": \"https://raw.githubusercontent.com/SubbuRamanathan/ordercloud-microsoft-teams-integration/master/images/user.png\"\r\n    },\r\n    \"BeforeProcessRequest\": false,\r\n    \"ApiClientIDs\": [\r\n        \"\",\r\n        \"\"\r\n    ],\r\n    \"WebhookRoutes\": [\r\n        {\r\n            \"Route\": \"v1/adminusers\",\r\n            \"Verb\": \"POST\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/adminusers/{userID}\",\r\n            \"Verb\": \"DELETE\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/adminusers/{userID}\",\r\n            \"Verb\": \"PATCH\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/adminusers/{userID}\",\r\n            \"Verb\": \"PUT\"\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://sandboxapi.ordercloud.io/v1/webhooks/yLGf5IEviESxpvYpKmFnxw","description":"<p>Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an admin user is created, updated, or deleted.</p>\n","urlObject":{"path":["v1","webhooks","yLGf5IEviESxpvYpKmFnxw"],"host":["https://sandboxapi.ordercloud.io"],"query":[],"variable":[]}},"response":[],"_postman_id":"dcc1c7da-a6c1-44ad-83d3-4d445650a371"},{"name":"Teams Notification for Buyers","event":[{"listen":"prerequest","script":{"id":"6aec7cd0-e839-49f6-bd2a-9baa16aa815d","exec":[""],"type":"text/javascript"}}],"id":"cc2c33ee-4356-4635-af11-bd82beb75561","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"ID\": \"dG-sT_GwLEiLLTWJKj2PTQ\",\r\n    \"Name\": \"Teams Notification for Buyers\",\r\n    \"Description\": \"Sends a notification to the Teams Webhook specified in the Configuration Data section whenever a buyer is created, updated, or deleted. \",\r\n    \"Url\": \"https://ordercloudfunctions.azurewebsites.net/api/updatenotifications-httptrigger?code=\",\r\n    \"HashKey\": \"\",\r\n    \"ElevatedRoles\": null,\r\n    \"ConfigData\": {\r\n        \"webhook\": \"\",\r\n        \"template\": \"default\",\r\n        \"title\": \"A Buyer('${Name}') has been ${status}\",\r\n        \"subtitle\": \"You can perform any action using the link(s) below\",\r\n        \"facts\": \"Name|ID|Active\",\r\n        \"actions\": \"{\\\"View/Edit Buyer\\\":\\\"http://seller.headstart.localhost/buyers/${ID}\\\",\\\"View All Buyers\\\":\\\"http://seller.headstart.localhost/buyers\\\"}\",\r\n        \"image\": \"https://raw.githubusercontent.com/SubbuRamanathan/ordercloud-microsoft-teams-integration/master/images/user.png\"\r\n    },\r\n    \"BeforeProcessRequest\": false,\r\n    \"ApiClientIDs\": [\r\n        \"\",\r\n        \"\"\r\n    ],\r\n    \"WebhookRoutes\": [\r\n        {\r\n            \"Route\": \"v1/buyers\",\r\n            \"Verb\": \"POST\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/buyers/{buyerID}\",\r\n            \"Verb\": \"DELETE\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/buyers/{buyerID}\",\r\n            \"Verb\": \"PATCH\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/buyers/{buyerID}\",\r\n            \"Verb\": \"PUT\"\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://sandboxapi.ordercloud.io/v1/webhooks/dG-sT_GwLEiLLTWJKj2PTQ","description":"<p>Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an admin user is created, updated, or deleted.</p>\n","urlObject":{"path":["v1","webhooks","dG-sT_GwLEiLLTWJKj2PTQ"],"host":["https://sandboxapi.ordercloud.io"],"query":[],"variable":[]}},"response":[],"_postman_id":"cc2c33ee-4356-4635-af11-bd82beb75561"},{"name":"Teams Notification for Orders","event":[{"listen":"prerequest","script":{"id":"52968817-b483-4360-82f9-4183078eb7ce","exec":[""],"type":"text/javascript"}}],"id":"34b992e3-8cc0-4cdf-b1d2-9166c718f35c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"ID\": \"mk5RKcCseEuJLcS8ZA47jQ\",\r\n    \"Name\": \"Teams Notification for Orders\",\r\n    \"Description\": \"Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an order is created, updated, or deleted\",\r\n    \"Url\": \"https://ordercloudfunctions.azurewebsites.net/api/updatenotifications-httptrigger?code=\",\r\n    \"HashKey\": \"\",\r\n    \"ElevatedRoles\": null,\r\n    \"ConfigData\": {\r\n        \"webhook\": \"\",\r\n        \"filters\": \"{\\\"DateSubmitted\\\":\\\"!null\\\"}\",\r\n        \"template\": \"default\",\r\n        \"title\": \"An Order('${ID}') has been ${status}\",\r\n        \"subtitle\": \"You can perform any action using the link(s) below\",\r\n        \"facts\": \"Total|PromotionDiscount|Status|DateCreated|DateSubmitted|DateDeclined|DateApproved|DateCanceled|DateCompleted|Comments\",\r\n        \"actions\": \"{\\\"View/Edit Order\\\":\\\"http://buyer.headstart.localhost/orders/${ID}\\\",\\\"View All Orders\\\":\\\"http://buyer.headstart.localhost/orders\\\",\\\"Contact Buyer User\\\":\\\"mailto:${FromUser.EmailID}\\\"}\",\r\n        \"image\": \"https://raw.githubusercontent.com/SubbuRamanathan/ordercloud-microsoft-teams-integration/master/images/order.png\"\r\n    },\r\n    \"BeforeProcessRequest\": false,\r\n    \"ApiClientIDs\": [\r\n        \"\",\r\n        \"\",\r\n        \"\"\r\n    ],\r\n    \"WebhookRoutes\": [\r\n        {\r\n            \"Route\": \"v1/orders/{direction}\",\r\n            \"Verb\": \"POST\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/orders/{direction}/{orderID}\",\r\n            \"Verb\": \"DELETE\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/orders/{direction}/{orderID}\",\r\n            \"Verb\": \"PATCH\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/orders/{direction}/{orderID}\",\r\n            \"Verb\": \"PUT\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/orders/{direction}/{orderID}/billto\",\r\n            \"Verb\": \"PATCH\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/orders/{direction}/{orderID}/billto\",\r\n            \"Verb\": \"PUT\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/orders/{direction}/{orderID}/fromuser\",\r\n            \"Verb\": \"PATCH\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/orders/{direction}/{orderID}/promotions/{promoCode}\",\r\n            \"Verb\": \"DELETE\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/orders/{direction}/{orderID}/shipto\",\r\n            \"Verb\": \"PATCH\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/orders/{direction}/{orderID}/shipto\",\r\n            \"Verb\": \"PUT\"\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://sandboxapi.ordercloud.io/v1/webhooks/mk5RKcCseEuJLcS8ZA47jQ","description":"<p>Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an admin user is created, updated, or deleted.</p>\n","urlObject":{"path":["v1","webhooks","mk5RKcCseEuJLcS8ZA47jQ"],"host":["https://sandboxapi.ordercloud.io"],"query":[],"variable":[]}},"response":[],"_postman_id":"34b992e3-8cc0-4cdf-b1d2-9166c718f35c"},{"name":"Teams Notification for Orders - Approved Notification","event":[{"listen":"prerequest","script":{"id":"6cf07ac9-23e6-44ba-bd58-e807bf40d4df","exec":[""],"type":"text/javascript"}}],"id":"5ed2dc43-76a2-461f-b635-11ae9471bad1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"ID\": \"ErK31oxLb0aCw_dwqtlSfQ\",\r\n    \"Name\": \"Teams Notification for Orders - Approved Notification\",\r\n    \"Description\": \"Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an order is approved\",\r\n    \"Url\": \"https://ordercloudfunctions.azurewebsites.net/api/updatenotifications-httptrigger?code=\",\r\n    \"HashKey\": \"\",\r\n    \"ElevatedRoles\": null,\r\n    \"ConfigData\": {\r\n        \"webhook\": \"\",\r\n        \"filters\": \"{}\",\r\n        \"template\": \"default\",\r\n        \"title\": \"An Order('${ID}') has been approved\",\r\n        \"subtitle\": \"You can perform any action using the link(s) below\",\r\n        \"facts\": \"Total|PromotionDiscount|Status|DateSubmitted|DateApproved|Comments\",\r\n        \"actions\": \"{\\\"View/Edit Order\\\":\\\"http://buyer.headstart.localhost/orders/${ID}\\\",\\\"View All Orders\\\":\\\"http://buyer.headstart.localhost/orders\\\",\\\"Contact Buyer User\\\":\\\"mailto:${FromUser.Email}\\\"}\",\r\n        \"image\": \"https://raw.githubusercontent.com/SubbuRamanathan/ordercloud-microsoft-teams-integration/master/images/approval.png\"\r\n    },\r\n    \"BeforeProcessRequest\": false,\r\n    \"ApiClientIDs\": [\r\n        \"\",\r\n        \"\",\r\n        \"\"\r\n    ],\r\n    \"WebhookRoutes\": [\r\n        {\r\n            \"Route\": \"v1/orders/{direction}/{orderID}/approve\",\r\n            \"Verb\": \"POST\"\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://sandboxapi.ordercloud.io/v1/webhooks/ErK31oxLb0aCw_dwqtlSfQ","description":"<p>Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an admin user is created, updated, or deleted.</p>\n","urlObject":{"path":["v1","webhooks","ErK31oxLb0aCw_dwqtlSfQ"],"host":["https://sandboxapi.ordercloud.io"],"query":[],"variable":[]}},"response":[],"_postman_id":"5ed2dc43-76a2-461f-b635-11ae9471bad1"},{"name":"Teams Notification for Orders - Awaiting Approval Notification","event":[{"listen":"prerequest","script":{"id":"22f26bd5-edb0-465a-827f-f727bc9c29e9","exec":[""],"type":"text/javascript"}}],"id":"0f0b9e72-ce38-4ebc-a6a6-a1d47a254747","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"ID\": \"l_35cnYluUO0sekv05Cstg\",\r\n    \"Name\": \"Teams Notification for Orders - Awaiting Approval Notification\",\r\n    \"Description\": \"Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an order is awaiting approval\",\r\n    \"Url\": \"https://ordercloudfunctions.azurewebsites.net/api/updatenotifications-httptrigger?code=\",\r\n    \"HashKey\": \"\",\r\n    \"ElevatedRoles\": null,\r\n    \"ConfigData\": {\r\n        \"webhook\": \"\",\r\n        \"filters\": \"{\\\"Status\\\":\\\"AwaitingApproval\\\"}\",\r\n        \"template\": \"default\",\r\n        \"title\": \"An Order('${ID}') has been submitted by '${FromUser.FirstName} ${FromUser.LastName}' and is awaiting approval\",\r\n        \"subtitle\": \"You can perform any action using the link(s) below\",\r\n        \"facts\": \"Total|PromotionDiscount|Status|DateCreated|DateSubmitted|Comments\",\r\n        \"actions\": \"{\\\"Approve/Decline Order\\\":\\\"http://buyer.headstart.localhost/orders/approve/${ID}\\\",\\\"View/Edit Order\\\":\\\"http://buyer.headstart.localhost/orders/${ID}\\\",\\\"Contact Buyer User\\\":\\\"mailto:${FromUser.Email}\\\"}\",\r\n        \"status\": \"pending approval\",\r\n        \"image\": \"https://raw.githubusercontent.com/SubbuRamanathan/ordercloud-microsoft-teams-integration/master/images/approval.png\"\r\n    },\r\n    \"BeforeProcessRequest\": false,\r\n    \"ApiClientIDs\": [\r\n        \"\",\r\n        \"\",\r\n        \"\"\r\n    ],\r\n    \"WebhookRoutes\": [\r\n        {\r\n            \"Route\": \"v1/orders/{direction}/{orderID}/submit\",\r\n            \"Verb\": \"POST\"\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://sandboxapi.ordercloud.io/v1/webhooks/l_35cnYluUO0sekv05Cstg","description":"<p>Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an admin user is created, updated, or deleted.</p>\n","urlObject":{"path":["v1","webhooks","l_35cnYluUO0sekv05Cstg"],"host":["https://sandboxapi.ordercloud.io"],"query":[],"variable":[]}},"response":[],"_postman_id":"0f0b9e72-ce38-4ebc-a6a6-a1d47a254747"},{"name":"Teams Notification for Orders - Canceled Notification","event":[{"listen":"prerequest","script":{"id":"881b67c2-bead-4837-a636-71e8ce4d09ba","exec":[""],"type":"text/javascript"}}],"id":"1e78f9dd-451d-45c7-8ff9-91697c4762ab","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"ID\": \"h68LMV9l8UGsHPBZr8irSw\",\r\n    \"Name\": \"Teams Notification for Orders - Canceled Notification\",\r\n    \"Description\": \"Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an order is canceled\",\r\n    \"Url\": \"https://ordercloudfunctions.azurewebsites.net/api/updatenotifications-httptrigger?code=\",\r\n    \"HashKey\": \"\",\r\n    \"ElevatedRoles\": null,\r\n    \"ConfigData\": {\r\n        \"webhook\": \"\",\r\n        \"filters\": \"{}\",\r\n        \"template\": \"default\",\r\n        \"title\": \"An Order('${ID}') has been canceled\",\r\n        \"subtitle\": \"You can perform any action using the link(s) below\",\r\n        \"facts\": \"Total|PromotionDiscount|Status|DateSubmitted|DateCanceled|Comments\",\r\n        \"actions\": \"{\\\"View/Edit Order\\\":\\\"http://buyer.headstart.localhost/orders/${ID}\\\",\\\"View All Orders\\\":\\\"http://buyer.headstart.localhost/orders\\\",\\\"Contact Buyer User\\\":\\\"mailto:${FromUser.Email}\\\"}\",\r\n        \"image\": \"https://raw.githubusercontent.com/SubbuRamanathan/ordercloud-microsoft-teams-integration/master/images/order.png\"\r\n    },\r\n    \"BeforeProcessRequest\": false,\r\n    \"ApiClientIDs\": [\r\n        \"\",\r\n        \"\",\r\n        \"\"\r\n    ],\r\n    \"WebhookRoutes\": [\r\n        {\r\n            \"Route\": \"v1/orders/{direction}/{orderID}/cancel\",\r\n            \"Verb\": \"POST\"\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://sandboxapi.ordercloud.io/v1/webhooks/h68LMV9l8UGsHPBZr8irSw","description":"<p>Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an admin user is created, updated, or deleted.</p>\n","urlObject":{"path":["v1","webhooks","h68LMV9l8UGsHPBZr8irSw"],"host":["https://sandboxapi.ordercloud.io"],"query":[],"variable":[]}},"response":[],"_postman_id":"1e78f9dd-451d-45c7-8ff9-91697c4762ab"},{"name":"Teams Notification for Orders - Completed Notification","event":[{"listen":"prerequest","script":{"id":"c3cd6e06-a33a-4582-8502-515722e661d5","exec":[""],"type":"text/javascript"}}],"id":"3d01cf94-a15b-4aed-ab6f-0b0182ae6876","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"ID\": \"3EecHTx_kUyvYIkZarHV1g\",\r\n    \"Name\": \"Teams Notification for Orders - Completed Notification\",\r\n    \"Description\": \"Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an order is completed\",\r\n    \"Url\": \"https://ordercloudfunctions.azurewebsites.net/api/updatenotifications-httptrigger?code=\",\r\n    \"HashKey\": \"\",\r\n    \"ElevatedRoles\": null,\r\n    \"ConfigData\": {\r\n        \"webhook\": \"\",\r\n        \"filters\": \"{}\",\r\n        \"template\": \"default\",\r\n        \"title\": \"An Order('${ID}') has been completed\",\r\n        \"subtitle\": \"You can perform any action using the link(s) below\",\r\n        \"facts\": \"Total|PromotionDiscount|Status|DateSubmitted|DateCompleted|Comments\",\r\n        \"actions\": \"{\\\"View/Edit Order\\\":\\\"http://buyer.headstart.localhost/orders/${ID}\\\",\\\"View All Orders\\\":\\\"http://buyer.headstart.localhost/orders\\\",\\\"Contact Buyer User\\\":\\\"mailto:${FromUser.Email}\\\"}\",\r\n        \"image\": \"https://raw.githubusercontent.com/SubbuRamanathan/ordercloud-microsoft-teams-integration/master/images/order.png\"\r\n    },\r\n    \"BeforeProcessRequest\": false,\r\n    \"ApiClientIDs\": [\r\n        \"\",\r\n        \"\",\r\n        \"\"\r\n    ],\r\n    \"WebhookRoutes\": [\r\n        {\r\n            \"Route\": \"v1/orders/{direction}/{orderID}/complete\",\r\n            \"Verb\": \"POST\"\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://sandboxapi.ordercloud.io/v1/webhooks/3EecHTx_kUyvYIkZarHV1g","description":"<p>Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an admin user is created, updated, or deleted.</p>\n","urlObject":{"path":["v1","webhooks","3EecHTx_kUyvYIkZarHV1g"],"host":["https://sandboxapi.ordercloud.io"],"query":[],"variable":[]}},"response":[],"_postman_id":"3d01cf94-a15b-4aed-ab6f-0b0182ae6876"},{"name":"Teams Notification for Orders - Rejected Notification","event":[{"listen":"prerequest","script":{"id":"05e3e114-be26-477a-b700-5ffb5e2e1195","exec":[""],"type":"text/javascript"}}],"id":"3f79c5ec-1945-4635-bab9-d7d1177b947f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"ID\": \"vw8GmYZXhkuHZDHqidkdvg\",\r\n    \"Name\": \"Teams Notification for Orders - Rejected Notification\",\r\n    \"Description\": \"Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an order is rejected\",\r\n    \"Url\": \"https://ordercloudfunctions.azurewebsites.net/api/updatenotifications-httptrigger?code=\",\r\n    \"HashKey\": \"\",\r\n    \"ElevatedRoles\": null,\r\n    \"ConfigData\": {\r\n        \"webhook\": \"\",\r\n        \"filters\": \"{}\",\r\n        \"template\": \"default\",\r\n        \"title\": \"An Order('${ID}') has been rejected\",\r\n        \"subtitle\": \"You can perform any action using the link(s) below\",\r\n        \"facts\": \"Total|PromotionDiscount|Status|DateSubmitted|DateDeclined|Comments\",\r\n        \"actions\": \"{\\\"View/Edit Order\\\":\\\"http://buyer.headstart.localhost/orders/${ID}\\\",\\\"View All Orders\\\":\\\"http://buyer.headstart.localhost/orders\\\",\\\"Contact Buyer User\\\":\\\"mailto:${FromUser.Email}\\\"}\",\r\n        \"image\": \"https://raw.githubusercontent.com/SubbuRamanathan/ordercloud-microsoft-teams-integration/master/images/approval.png\",\r\n        \"status\": \"delete\"\r\n    },\r\n    \"BeforeProcessRequest\": false,\r\n    \"ApiClientIDs\": [\r\n        \"\",\r\n        \"\",\r\n        \"\"\r\n    ],\r\n    \"WebhookRoutes\": [\r\n        {\r\n            \"Route\": \"v1/orders/{direction}/{orderID}/decline\",\r\n            \"Verb\": \"POST\"\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://sandboxapi.ordercloud.io/v1/webhooks/vw8GmYZXhkuHZDHqidkdvg","description":"<p>Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an admin user is created, updated, or deleted.</p>\n","urlObject":{"path":["v1","webhooks","vw8GmYZXhkuHZDHqidkdvg"],"host":["https://sandboxapi.ordercloud.io"],"query":[],"variable":[]}},"response":[],"_postman_id":"3f79c5ec-1945-4635-bab9-d7d1177b947f"},{"name":"Teams Notification for Price Schedules","event":[{"listen":"prerequest","script":{"id":"558cbd0e-8266-4e2d-a598-e8647f7f31a8","exec":[""],"type":"text/javascript"}}],"id":"bdb72caa-538d-4d42-88c4-ade865b85871","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"ID\": \"Xv0jLzdKiUmNzWoIa9MoUg\",\r\n    \"Name\": \"Teams Notification for Price Schedules\",\r\n    \"Description\": \"Sends a notification to the Teams Webhook specified in the Configuration Data section whenever a price schedule is created, updated, or deleted. \",\r\n    \"Url\": \"https://ordercloudfunctions.azurewebsites.net/api/updatenotifications-httptrigger?code=\",\r\n    \"HashKey\": \"\",\r\n    \"ElevatedRoles\": null,\r\n    \"ConfigData\": {\r\n        \"webhook\": \"\",\r\n        \"template\": \"default\",\r\n        \"title\": \"A Price Schedule('${Name}') has been ${status}\",\r\n        \"subtitle\": \"You can perform any action using the link(s) below\",\r\n        \"facts\": \"Name|ID|Active\",\r\n        \"actions\": \"{\\\"View Product\\\":\\\"http://buyer.headstart.localhost/products/${ID}\\\",\\\"Edit Price Schedule\\\":\\\"http://seller.headstart.localhost/products/${ID}/price\\\",\\\"Request Indexing\\\":\\\"https://www.google.com/ping?sitemap=https%3a%2f%2fbuyer.headstart.localhost%2fsitemap.xml\\\"}\",\r\n        \"image\": \"https://raw.githubusercontent.com/SubbuRamanathan/ordercloud-microsoft-teams-integration/master/images/pricing.png\"\r\n    },\r\n    \"BeforeProcessRequest\": false,\r\n    \"ApiClientIDs\": [\r\n        \"\",\r\n        \"\"\r\n    ],\r\n    \"WebhookRoutes\": [\r\n        {\r\n            \"Route\": \"v1/priceschedules\",\r\n            \"Verb\": \"POST\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/priceschedules/{priceScheduleID}\",\r\n            \"Verb\": \"DELETE\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/priceschedules/{priceScheduleID}\",\r\n            \"Verb\": \"PATCH\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/priceschedules/{priceScheduleID}\",\r\n            \"Verb\": \"PUT\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/priceschedules/{priceScheduleID}/PriceBreaks\",\r\n            \"Verb\": \"DELETE\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/priceschedules/{priceScheduleID}/PriceBreaks\",\r\n            \"Verb\": \"POST\"\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://sandboxapi.ordercloud.io/v1/webhooks/Xv0jLzdKiUmNzWoIa9MoUg","description":"<p>Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an admin user is created, updated, or deleted.</p>\n","urlObject":{"path":["v1","webhooks","Xv0jLzdKiUmNzWoIa9MoUg"],"host":["https://sandboxapi.ordercloud.io"],"query":[],"variable":[]}},"response":[],"_postman_id":"bdb72caa-538d-4d42-88c4-ade865b85871"},{"name":"Teams Notification for Products","event":[{"listen":"prerequest","script":{"id":"be1a052b-0441-4ada-9e90-edc2995034f9","exec":[""],"type":"text/javascript"}}],"id":"60e66a65-d17c-46ee-b42e-72ab54413edb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"ID\": \"EPL4EV7HjUGYLN7NtaCSMA\",\r\n    \"Name\": \"Teams Notification for Products\",\r\n    \"Description\": \"Sends a notification to the Teams Webhook specified in the Configuration Data section whenever a product is created, updated, or deleted. \",\r\n    \"Url\": \"https://ordercloudfunctions.azurewebsites.net/api/updatenotifications-httptrigger?code=\",\r\n    \"HashKey\": \"\",\r\n    \"ElevatedRoles\": null,\r\n    \"ConfigData\": {\r\n        \"webhook\": \"\",\r\n        \"template\": \"default\",\r\n        \"title\": \"A Product('${Name}') has been ${status}\",\r\n        \"subtitle\": \"You can perform any action using the link(s) below\",\r\n        \"facts\": \"Name|ID|Active\",\r\n        \"actions\": \"{\\\"View Product\\\":\\\"http://buyer.headstart.localhost/products/${ID}\\\",\\\"Edit Product\\\":\\\"http://seller.headstart.localhost/products/${ID}\\\",\\\"Request Indexing\\\":\\\"https://www.google.com/ping?sitemap=https%3a%2f%2fbuyer.headstart.localhost%2fsitemap.xml\\\"}\",\r\n        \"image\": \"http://buyer.headstart.localhost/images/${ID}\"\r\n    },\r\n    \"BeforeProcessRequest\": false,\r\n    \"ApiClientIDs\": [\r\n        \"\",\r\n        \"\"\r\n    ],\r\n    \"WebhookRoutes\": [\r\n        {\r\n            \"Route\": \"v1/products\",\r\n            \"Verb\": \"POST\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/products/{productID}\",\r\n            \"Verb\": \"DELETE\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/products/{productID}\",\r\n            \"Verb\": \"PATCH\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/products/{productID}\",\r\n            \"Verb\": \"PUT\"\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://sandboxapi.ordercloud.io/v1/webhooks/EPL4EV7HjUGYLN7NtaCSMA","description":"<p>Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an admin user is created, updated, or deleted.</p>\n","urlObject":{"path":["v1","webhooks","EPL4EV7HjUGYLN7NtaCSMA"],"host":["https://sandboxapi.ordercloud.io"],"query":[],"variable":[]}},"response":[],"_postman_id":"60e66a65-d17c-46ee-b42e-72ab54413edb"},{"name":"Teams Notification for Promotions","event":[{"listen":"prerequest","script":{"id":"daee3bb0-1057-4684-abbc-665d671e7ab8","exec":[""],"type":"text/javascript"}}],"id":"d7f51489-2c68-4733-a993-88dce7ee0b69","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"ID\": \"SroEuWaVMEOsUSrW9rVQIQ\",\r\n    \"Name\": \"Teams Notification for Promotions\",\r\n    \"Description\": \"Sends a notification to the Teams Webhook specified in the Configuration Data section whenever a promotion is created, updated, or deleted. \",\r\n    \"Url\": \"https://ordercloudfunctions.azurewebsites.net/api/updatenotifications-httptrigger?code=\",\r\n    \"HashKey\": \"\",\r\n    \"ElevatedRoles\": null,\r\n    \"ConfigData\": {\r\n        \"webhook\": \"\",\r\n        \"template\": \"default\",\r\n        \"title\": \"A Promotion('${Name}') has been ${status}\",\r\n        \"subtitle\": \"You can perform any action using the link(s) below\",\r\n        \"facts\": \"Code|Description|StartDate|ExpirationDate\",\r\n        \"actions\": \"{\\\"Go to Site\\\":\\\"http://buyer.headstart.localhost/\\\",\\\"View/Edit Promotion\\\":\\\"http://seller.headstart.localhost/promotions/${ID}\\\",\\\"View All Promotions\\\":\\\"http://seller.headstart.localhost/promotions\\\",\\\"Request Indexing\\\":\\\"https://www.google.com/ping?sitemap=https%3a%2f%2fbuyer.headstart.localhost%2fsitemap.xml\\\"}\",\r\n        \"image\": \"https://raw.githubusercontent.com/SubbuRamanathan/ordercloud-microsoft-teams-integration/master/images/promotion.png\"\r\n    },\r\n    \"BeforeProcessRequest\": false,\r\n    \"ApiClientIDs\": [\r\n        \"\",\r\n        \"\"\r\n    ],\r\n    \"WebhookRoutes\": [\r\n        {\r\n            \"Route\": \"v1/promotions\",\r\n            \"Verb\": \"POST\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/promotions/{promotionID}\",\r\n            \"Verb\": \"DELETE\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/promotions/{promotionID}\",\r\n            \"Verb\": \"PATCH\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/promotions/{promotionID}\",\r\n            \"Verb\": \"PUT\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/promotions/{promotionID}/assignments\",\r\n            \"Verb\": \"DELETE\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/promotions/assignments\",\r\n            \"Verb\": \"POST\"\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://sandboxapi.ordercloud.io/v1/webhooks/SroEuWaVMEOsUSrW9rVQIQ","description":"<p>Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an admin user is created, updated, or deleted.</p>\n","urlObject":{"path":["v1","webhooks","SroEuWaVMEOsUSrW9rVQIQ"],"host":["https://sandboxapi.ordercloud.io"],"query":[],"variable":[]}},"response":[],"_postman_id":"d7f51489-2c68-4733-a993-88dce7ee0b69"},{"name":"Teams Notification for Supplier Users","event":[{"listen":"prerequest","script":{"id":"c9765ca1-2860-4238-8628-1082ef63ba6c","exec":[""],"type":"text/javascript"}}],"id":"aaca0d6d-9efc-427a-9589-58b0036c8cd2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"ID\": \"6mZkj4S4UE2pIXv-CUqr-A\",\r\n    \"Name\": \"Teams Notification for Supplier Users\",\r\n    \"Description\": \"Sends a notification to the Teams Webhook specified in the Configuration Data section whenever a supplier user is created, updated, or deleted. \",\r\n    \"Url\": \"https://ordercloudfunctions.azurewebsites.net/api/updatenotifications-httptrigger?code=\",\r\n    \"HashKey\": \"\",\r\n    \"ElevatedRoles\": null,\r\n    \"ConfigData\": {\r\n        \"webhook\": \"\",\r\n        \"template\": \"default\",\r\n        \"title\": \"A Supplier User('${FirstName} ${LastName}') has been ${status}\",\r\n        \"subtitle\": \"You can perform any action using the link(s) below\",\r\n        \"facts\": \"Username|ID|Email|Active\",\r\n        \"actions\": \"{\\\"View/Edit User\\\":\\\"http://seller.headstart.localhost/suppliers/${supplierID}/users/${ID}\\\",\\\"View All Users\\\":\\\"http://seller.headstart.localhost/suppliers/${supplierID}/users/\\\"}\",\r\n        \"image\": \"https://raw.githubusercontent.com/SubbuRamanathan/ordercloud-microsoft-teams-integration/master/images/user.png\"\r\n    },\r\n    \"BeforeProcessRequest\": false,\r\n    \"ApiClientIDs\": [\r\n        \"\",\r\n        \"\"\r\n    ],\r\n    \"WebhookRoutes\": [\r\n        {\r\n            \"Route\": \"v1/suppliers/{supplierID}/users\",\r\n            \"Verb\": \"POST\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/suppliers/{supplierID}/users/{userID}\",\r\n            \"Verb\": \"DELETE\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/suppliers/{supplierID}/users/{userID}\",\r\n            \"Verb\": \"PATCH\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/suppliers/{supplierID}/users/{userID}\",\r\n            \"Verb\": \"PUT\"\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://sandboxapi.ordercloud.io/v1/webhooks/6mZkj4S4UE2pIXv-CUqr-A","description":"<p>Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an admin user is created, updated, or deleted.</p>\n","urlObject":{"path":["v1","webhooks","6mZkj4S4UE2pIXv-CUqr-A"],"host":["https://sandboxapi.ordercloud.io"],"query":[],"variable":[]}},"response":[],"_postman_id":"aaca0d6d-9efc-427a-9589-58b0036c8cd2"},{"name":"Teams Notification for Suppliers","event":[{"listen":"prerequest","script":{"id":"d1f6f57e-9afe-49e6-ab0f-0359fd5c59fd","exec":[""],"type":"text/javascript"}}],"id":"cdb04a4b-7aaf-4ecd-a9ac-660b463f8947","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"ID\": \"Ywetauwa0kypTrZeLdOwCA\",\r\n    \"Name\": \"Teams Notification for Suppliers\",\r\n    \"Description\": \"Sends a notification to the Teams Webhook specified in the Configuration Data section whenever a supplier is created, updated, or deleted. \",\r\n    \"Url\": \"https://ordercloudfunctions.azurewebsites.net/api/updatenotifications-httptrigger?code=\",\r\n    \"HashKey\": \"\",\r\n    \"ElevatedRoles\": null,\r\n    \"ConfigData\": {\r\n        \"webhook\": \"\",\r\n        \"template\": \"default\",\r\n        \"title\": \"A Supplier('${Name}') has been ${status}\",\r\n        \"subtitle\": \"You can perform any action using the link(s) below\",\r\n        \"facts\": \"Name|ID|Active\",\r\n        \"actions\": \"{\\\"View/Edit Supplier\\\":\\\"http://seller.headstart.localhost/suppliers/${ID}\\\",\\\"View All Suppliers\\\":\\\"http://seller.headstart.localhost/suppliers\\\"}\",\r\n        \"image\": \"https://raw.githubusercontent.com/SubbuRamanathan/ordercloud-microsoft-teams-integration/master/images/user.png\"\r\n    },\r\n    \"BeforeProcessRequest\": false,\r\n    \"ApiClientIDs\": [\r\n        \"\",\r\n        \"\"\r\n    ],\r\n    \"WebhookRoutes\": [\r\n        {\r\n            \"Route\": \"v1/suppliers\",\r\n            \"Verb\": \"POST\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/suppliers/{supplierID}\",\r\n            \"Verb\": \"DELETE\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/suppliers/{supplierID}\",\r\n            \"Verb\": \"PATCH\"\r\n        },\r\n        {\r\n            \"Route\": \"v1/suppliers/{supplierID}\",\r\n            \"Verb\": \"PUT\"\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://sandboxapi.ordercloud.io/v1/webhooks/Ywetauwa0kypTrZeLdOwCA","description":"<p>Sends a notification to the Teams Webhook specified in the Configuration Data section whenever an admin user is created, updated, or deleted.</p>\n","urlObject":{"path":["v1","webhooks","Ywetauwa0kypTrZeLdOwCA"],"host":["https://sandboxapi.ordercloud.io"],"query":[],"variable":[]}},"response":[],"_postman_id":"cdb04a4b-7aaf-4ecd-a9ac-660b463f8947"}],"id":"a5f893f1-f36c-4032-9bc4-2411da7db0fd","_postman_id":"a5f893f1-f36c-4032-9bc4-2411da7db0fd","description":""}],"event":[{"listen":"prerequest","script":{"id":"228eda06-3b24-4bbd-a55f-0d07e4b12613","type":"text/javascript","exec":["const accessTokenUrl = `${pm.collectionVariables.get('baseUrl')}/oauth/token`;","const clientId = pm.collectionVariables.get('clientID');","const clientSecret = pm.collectionVariables.get('clientSecret');","","const getAccessToken = {","  method: 'POST',","  url: accessTokenUrl,","  body: {","      mode: 'formdata',","      formdata: [","          { key: 'grant_type', value: 'client_credentials' },","          { key: 'client_id', value: clientId },","          { key: 'client_secret', value: clientSecret }","      ]","  }","};","","if(!clientId || !clientSecret)","  throw new Error(\"'clientId' and 'clientSecret' variables must be populated\")","","pm.sendRequest(getAccessToken, (error, response) => {","  if(error)","    throw new Error(error);","","  const result = response.json();","  if(!result.access_token)","    throw new Error(`${result.error}: ${result.error_description}`);","","  pm.request.headers.add({ key: 'Authorization', value: `Bearer ${result.access_token}` });","});"]}},{"listen":"test","script":{"id":"c4ed006f-e509-4e97-8f46-dab970df4510","type":"text/javascript","exec":[""]}}],"variable":[{"key":"baseUrl","value":"https://sandboxapi.ordercloud.io"},{"key":"clientID","value":""},{"key":"clientSecret","value":""},{"key":"azureFunctionHostUrl","value":"https://ordercloudfunctions.azurewebsites.net"},{"key":"azureFunctionAPIKey","value":""},{"key":"webhookSecret","value":""},{"key":"sellerWebsiteHostUrl","value":"http://seller.headstart.localhost"},{"key":"sellerApiClientID","value":""},{"key":"sellerTeamsWebhookUrl","value":""},{"key":"supplierTeamsWebhookUrl","value":""},{"key":"buyerWebsiteHostUrl","value":"http://buyer.headstart.localhost"},{"key":"buyerApiClientID","value":""},{"key":"buyerTeamsWebhookUrl","value":""},{"key":"middlewareApiClientID","value":""}]}