1

I have a MessageCard which I am sending to my Teams channel via the Incoming Webhook connector. This is working well. However, the card has the button with HttpPOST Action. In "target" I defined URL to my API in the format: "http://user:pass@address/resource/action.html?add2Queue=test". When I am trying to push button I am getting the error: "Target URL scheme 'http://user:pass@address/resource/action.html?add2Queue=test' is not allowed.". I didn't find any restrictions for using HTTP. I am using the "Incoming Webhook" connector.

Is it works with HTTP or only HTTPS?

JSON:

{
    "@type": "MessageCard",
    "@context": "http://schema.org/extensions",
    "themeColor": "0076D7",
    "summary": "Action on environments status change",
    "sections": [{
        "activityTitle": "Envrionments status are going to change",
        "facts": [{
            "name": "Environment:",
            "value": "3"
        }, {
            "name": "Due date",
            "value": "On Friday 8:00 PM Central Time"
        }, {
            "name": "Pending Action",
            "value": "Environment are going to be stopped"
        }, {
            "name": "Notes",
            "value": "You can pause this action by pressing Pause button bellow"
        }],
        "markdown": true
    }],
    "potentialAction": [{
        "@type": "HttpPOST",
        "name": "Pause Action",
        "actions": [{
            "@type": "HttpPOST",
            "name": "Pause",
            "target": "http://user:pass@server/teamcity/httpAuth/action.html?add2Queue=Marlin_Infrastructure_MarlinInfrastructureStopStartEnvironments_TechnicalTasks_N"
        }]
    }]
}
Dr.Crazy
  • 1,623
  • 1
  • 7
  • 8
  • Possible duplicate of [Get "Target URL ... is not allowed" error message when actioning Outlook actionable message for external email user](https://stackoverflow.com/questions/49353582/get-target-url-is-not-allowed-error-message-when-actioning-outlook-actiona) – nbk Oct 02 '19 at 22:46
  • Could you please check your connector registration is pending or approved? Pending connector's functionality is limited. Most cross tenant operations are blocked. – Trinetra-MSFT Oct 03 '19 at 05:02
  • @Trinetra-MSFT I am using the "Incoming Webhook" connector. Does it have to be registered or addtionaly configured to use HTTP? – Dr.Crazy Oct 03 '19 at 08:51
  • We are looking into this. Meanwhile, could you please confirm if you have enabled actions on your Connector cards in [Connector Portal](https://outlook.office.com/connectors/publish)? – Trinetra-MSFT Oct 09 '19 at 09:50
  • @Trinetra-MSFT The webhook connector is one of the standard connectors supported by Office 365 so I can't configure it. – Dr.Crazy Oct 13 '19 at 17:59
  • @Dr.Crazy Could you please share the json payload that you are posting? – Gousia Begum Oct 23 '19 at 06:21
  • @Trinetra-MSFT I added it to message – Dr.Crazy Oct 25 '19 at 11:13
  • could you please set the target URL to one of the URLs generated on [webhook.site](https://webhook.site/) and see if it's hitting when you click on Pause Action? – Gousia Begum Oct 29 '19 at 08:48
  • I tried and got the error: "Failed to send Target is not set or not in URL format." – Dr.Crazy Oct 29 '19 at 15:59
  • Could you please check if your URL is a https url? – Gousia Begum Oct 31 '19 at 09:06
  • My URL is http, but URL from webhook.site was https – Dr.Crazy Nov 01 '19 at 13:40
  • Please take a look at [connector sample code](https://github.com/OfficeDev/microsoft-teams-sample-connector-csharp). – Trinetra-MSFT Nov 11 '19 at 09:26
  • @Trinetra-MSFT I don't need a custom connector. I want to use the "Incoming Webhook" that exists by default in MS Teams. – Dr.Crazy Nov 14 '19 at 10:43
  • Did you add your target domain with in the valid Domain list of your app manifest? – Trinetra-MSFT Dec 02 '19 at 07:33

1 Answers1

3

Explanation of Teams sending a bearer authorization token can be found here
Based on that I did:

        "@type": "HttpPOST",
        "name": "Your Action",
        "target": "https://www.your-url.com",
        "headers": [
            {
                "name": "Authorization",
                "value": null
            }
        ],
        "body": "{\"whateverdata\"}"

and it worked for me. Works on Teams , I imagine it should work for outlook as well

enter image description here

brohymn
  • 460
  • 5
  • 22