0

如果我希望我的 Actionable Message 将 HttpPOST 发送到 Azure Function 或 Azure 逻辑应用,我该如何让它工作?

我已经尝试了以下两个 senario,但没有任何运气:

  1. 带有 Azure Active Directory 身份验证的 Azure 函数。当我调用它时,我得到以下响应:

    {
       "innerErrorCode":"ProviderException",
       "innerErrorMessage":null,
       "authenticationUrl":null,
       "displayMessage":"The action could not be completed."
    }
    

此目标 URL 已在 Actionable Email Developer Dashboard 中注册。

该功能甚至没有被触发,因此错误来自 /actions/userid/messages/.../executeAction 调用。

  1. 没有身份验证的 Azure 函数,我得到以下响应:

    {
       "innerErrorCode":"InvalidTargetUrlException",
       "innerErrorMessage":null,
       "authenticationUrl":null,
       "displayMessage":"Target URL 
       'https://mysite.azurewebsites.net/api/ActionableMessage' is not allowed."
    }
    

谢谢

4

1 回答 1

0

你能分享你用来发送邮件的可操作消息 json 吗?

您需要有一个潜在操作条目作为输入以及后续操作,例如选项多选表示为:

{
    "@type": "ActionCard",
    "name": "SelectResource",
    "inputs": [
      {
        "@type": "MultichoiceInput",
        "id": "<id_which_will_be_used_for_fetching_value>",
        "isRequired":  true,
        "title": "Pick an option",
        "style": "expanded",
        "choices": $6
      }
    ],
    "actions": [
      {
        "@type": "HttpPOST",
        "name": "Select one of the resource for booking",
        "target": "your_azure_function_url",
        "body": "{{<id_of_the_input>.value}}" //will be received in function
      }
    ]
  }
于 2018-01-08T09:10:10.990 回答