You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

通过APIM提交文件到Logic App处理时HTTP触发器的JSON schema如何配置

Logic App HTTP触发器Request JSON schema配置方案

根据你提供的swagger定义,你的接口是multipart/form-data格式的POST请求,携带必填的transactionId请求头和employeefile文本文件表单参数,你可以直接用以下JSON作为Request触发器的schema配置:

{
    "type": "object",
    "properties": {
        "headers": {
            "type": "object",
            "properties": {
                "transactionId": {
                    "type": "string",
                    "format": "uuid"
                }
            },
            "required": ["transactionId"]
        },
        "formData": {
            "type": "object",
            "properties": {
                "employeefile": {
                    "type": "object",
                    "properties": {
                        "content": {
                            "type": "string"
                        },
                        "contentType": {
                            "type": "string",
                            "pattern": "^text/plain.*"
                        },
                        "fileName": {
                            "type": "string"
                        }
                    },
                    "required": ["content", "contentType", "fileName"]
                }
            },
            "required": ["employeefile"]
        }
    },
    "required": ["headers", "formData"]
}

配置说明

  • 填写上述schema后,触发器会自动对入参做合法性校验:请求头缺少transactionId、格式不是UUID、表单缺少employeefile、文件类型不是text/plain的请求会被直接拦截返回400错误,不需要你额外编写校验逻辑。
  • 后续在Logic App工作流中读取文本文件内容时,直接使用表达式triggerBody()?['formData']?['employeefile']?['content']即可获取到完整的文本内容,无需额外解码操作。
  • 如果你不需要自动校验入参,也可以直接留空Request JSON schema字段,触发器会接收所有格式的请求,你可以在后续步骤中自行提取所需参数。
  • APIM侧直接将请求原样透传给Logic App的触发URL即可,无需额外做报文转换,只需确保transactionId请求头被正常转发。

内容的提问来源于stack exchange,提问作者Nathan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.04 08:57:03