Aug 11 2020 06:32 AM - edited Aug 11 2020 06:33 AM
Hi there,
I've been trying to get my web app (javascript) to send a message to a microsoft teams channel. I went through the steps of the "getting-started" page and then referred to this tutorial: https://medium.com/@john_93626/automating-posts-to-microsoft-teams-using-javascript-2b5afeab1974 .
Problem is, whenever i try to send a Post request to my url (using axios or XMLHttpRequest), i got an error saying: Access to XMLHttpRequest at 'https://outlook.office.com/webhook/8857e17c-5ad9-4561-8970-180c05644bc4@0400011a-0b87-4500-ac8a-610b...' from origin 'http://localhost:3030' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
As you can see in my code below, i added the 'Access-Control-Allow-Origin' header to my request, but I still get the same error.
Aug 18 2020 12:16 AM
@joschroth Could you please follow the guide here to Send Messages to Connectors and Webhooks.
Also could you please confirm if you have added actions in the Connector registration portal?
Aug 25 2020 02:07 AM
@Gousia_Begum Hi! Yeah I've followed the steps of the guide closely, problem is they only send the JSON via Curl or Postman, not through an Http post request. Whats the connector registration portal? Did you mean the dialog inside of teams where you can manage your connectors etc.?
Best regards,
Josch