如何在Azure Logic Apps自定义连接器中返回文件 [英] How to return a file in a Azure Logic Apps Custom Connector

查看:56
本文介绍了如何在Azure Logic Apps自定义连接器中返回文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的自定义连接器中有一个响应为200 OK的操作和一个文件(pdf).在我的OpenAPI/Swagger 2.0文件中,它的定义如下:

I have an action in my custom connector that responds 200 OK and a file (a pdf). In my OpenAPI/Swagger 2.0 file it is defined like this:

    "/blogs/{blogId}/articles/{articleId}.pdf" : {
        "get" : {
            "operationId": "GetArticlePdf",
            "summary": "Find a article PDF by id",
            "description": "Returns a single article PDF",
            "produces":[
                "application/pdf"
            ],
            "parameters":[
                {
                    "name": "articleId",
                    "in": "path",
                    "type": "string",
                    "format": "uuid",
                    "description": "Article Id",
                    "required": true
                },
                {
                    "name": "blogId",
                    "in" : "path",
                    "required": true,
                    "type": "integer"
                }
            ],
            "responses": {
                "200": {
                    "description": "OK",
                    "schema":{
                        "type":"file"
                    }
                },
                "404": {
                    "description": "Not Found"
                },
                "400": {
                    "description": "Bad Request"
                }
            }
        }
    }

但是当我在Logic App中使用此自定义连接器时,在下一步中,该操作(文件)的响应未在动态内容选择器中列出.

But when I use this custom connector in a Logic App, the response of this action (the file) is not listed in the dynamic content selector in the next steps.

如何定义动作,以便在后续步骤中将其响应文件用作输入?

How can I define the action so I can use its response file in the next steps as an input?

推荐答案

您所定义的内容看起来很明智.

What you have looks fine definition wise.

请记住,尽管源可能是http和LogicApps的文件",但它只是由@body元素表示的http内容.

Keep in mind, while the source might be a 'file', to http and LogicApps, it's just http content represented by the @body element.

除非您专门对该服务编程以执行其他操作,否则我希望它采用Base64编码.

I would expect it to be Base64 encoded unless you are specifically programming the service to do something else.

这篇关于如何在Azure Logic Apps自定义连接器中返回文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆