I've been using Webhook connector to post messages from my CRM into Teams Channel. I'm now trying to migrate to the new WorkFlow.
I have created a new workflow as per the below steps:
1. Apps > Workflow > All Templates > Post to a chat when a webhook request is received
2. Microsoft Teams [NEXT]
3. Selected the TEAM & Channel [Add WorkFlow]
DONE
Now, I'm using the following PHP code to post a message to Teams Channel.
<?php
$msg = "Please ignore: " . date("Y-M-d");
$url = 'https://prod2-20.centralindia.logic.azure.com:443/workflows/3357f.....w7gGwDU8';
$data = array("@context" => "http://schema.org/extensions","@type" => "messagecard","text"=>$msg);
$postdata = json_encode($data);
$ch1 = curl_init($url);
curl_setopt($ch1, CURLOPT_POST, 1);
curl_setopt($ch1, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch1, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
$result1 = curl_exec($ch1);
curl_close($ch1);
?>
When executing the above code, I get the following error:
Someone please help me fix this issue..
Thanks