Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Trouble Downloading PDF from API via Custom Connector

I am trying to create a custom connector that send to a custom API which converts and returns a PDF.  It works with Postman if I "Send and Download" the request, and almost works with the custom connector.  Testing it returns a 200 code but the file doesn't download.


When I Try it Out, in the swagger view, I get 2 responses although I expect only 1, the PDF.  The first response in Server Response and it appears to be the file, albeit a txt file instead of PDF.  The second response is called Responses and appears link with the swagger file , but only shows "Example Value... string".  I suspect that a specific tweak of the swagger file will get it to work as expected.  Any ideas?


Here is the swagger and Try it out results:









Super User
Super User

Re: Trouble Downloading PDF from API via Custom Connector

Hi @rarroyo1

I think you have a fair bit of work to do on your swagger document.

  • The consumes and produces value should be "application/json" and not blank or the mime type of the generated document.
  • The response schema should cover all the properties returned, with the document similar to:
  • "FileContent": {
              "format": "byte",
              "type": "string",
              "x-ms-visibility": "important",
              "x-ms-summary": "File Content",
              "description": "The processed document."

For examples review:




If I have answered your question, please mark your post as Solved.

If you like my response, please give it a Thumbs Up


Helpful resources


Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!


Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!


New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!


Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Power Platform World Tour

Find out where you can attend!


Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users online (5,328)