I have some tests working in Postman that POST binary data (.jpg) to an endpoint. This works just fine, but there is no visible schema for the `body` of this request. Its just "binary data" I guess.
What do I select in PowerApps Custom Connector to allow binary data in the `body`? Do I need a schema of some sort?
Hi,
Can you please tell us little more what you are trying to do? Where is this binary data coming from? You can probably work with content-type for this. Also look at this article to work with base64 encoding and binary data: https://linnzawwin.blogspot.com/2021/02/handle-base64-and-binary-file-content.html
If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION ☑️. If you find this reply helpful, please consider giving it a LIKE 👍.
I had the same problem and finally figured it out. You can use the Swagger editor and add a body parameter like this:
parameters:
- name: body
in: body
schema: {type: string, format: binary}
It appears as a string parameter in the swagger editor and on the custom connector testing tab, but then when you're in the actual flow editor you can put the "File content" from a previous step in there and it gets sent as plain binary. I absolutely did not expect that to work, but it does.
Hope that helps anyone else stumbling across this post because they're stuck on the same thing!
Edit: I later noticed that the paconn validate tool gives a warning that "the MIME type 'application/octet-stream' is not supported" when I try to set the content-type. So maybe what I discovered was a dirty hack, and not the intended behaviour after all.
I was able to figure this out. Believe it or not, the Body was not required!
Glad you figured yours out! I just edited my solution to note that I'm still getting an ominous warning. So far it's been working fine, but what I'm doing doesn't seem to be officially supported.
here is an example from Github:
https://github.com/microsoft/PowerPlatformConnectors/blob/master/custom-connectors/ServiceNow/apiDef...
there is an example POST on line 471 - 644,
631-640 contains the file element
i'm not sure what to make of this information.... but hopefully it helps someone 🙂
(there is a content type element on row 611 - 630 too)
note: the above is in JSON, so you will need to convert to YAML to use in your custom connector
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Read the latest about new experiences and capabilities in the Power Automate product blog.
If you are a small business ISV/Reseller, share your thoughts with our research team.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |