在Azure Logic Apps中使用HTTP操作时,如何在JSON主体中使用“@ odata.id”?

时间:2018-05-08 17:46:51

标签: azure microsoft-graph azure-logic-apps

我正在使用Azure Logic Apps使用HTTP - HTTP操作调出Microsoft Graph API。对于此API,我需要使用以下正文执行POST请求:

{
   "@odata.id": "<guid>"
}

当我尝试保存逻辑应用程序时,此错误显示:

Failed to save logic app <redacted>. The template validation failed: 'The template action '<redacted>' at line '1' and column '144589' is not valid: "Unable to parse template language expression 'odata.id': expected token 'LeftParenthesis' and actual 'Dot'.".'.

如何在我的JSON有效负载中使用此属性?

编辑:根据要求,生成保存错误的逻辑应用程序部分的屏幕截图。 dot in attribute triggers save error

1 个答案:

答案 0 :(得分:4)

从这篇文章:

Logic Apps workflow definitions with the Workflow Definition Language schema

  

如果您有一个以@字符开头的文字字符串,请在@字符前加上另一个@字符作为转义字符:@@

所以在你的情况下,这应该有效:

{
  "@@odata.id": "your value here"
}