Copy link to clipboard
Copied
I have a Logic App that monitors incoming emails. Some have multiple PDF attachments that I want to merge and save to Dropbox. I have it working with the Encodian API but I want to switch it over to the Adobe API.
I then use the array as input for the Encodian API. When I try this with the Adobe API, I get an error,
"$content-type": "application/pdf"
This still returns the same error.
Even though the files were already PDF's I thought maybe they still needed to be converted to Base64 so I tried that.
The Append array action generates this result:
[
{
"$content-type":"application/pdf",
"fileContent":"SlZCRVJ..."
},
{
"$content-type":"application/pdf",
"fileContent":"SlZCRVJ..."
}
]
The error again is:
"bad value for parameter 'files'; invalid type".
the full code for the action is:
{
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['adobepdftools']['connectionId']"
}
},
"method": "post",
"body": {
"files": "@variables('FileToMerge')",
"outputFileName": "Temp.pdf"
},
"headers": {
"x-api-key": "PowerAutomate",
"x-region-value": "-ue1"
},
"path": "/operation/v1/combinePDF"
}
}
Why does this have to be so difficult? Where am I going wrong?
For anyone looking for the same answer, I was finally able to get this sorted out.
If you are using the 'When a new email arrives' trigger, you need to append to the array variable (mine is named 'FilesToMerge' ) using a 'For each' loop based on the trigger body output:
triggerBody()?['attachments']
Then append the contentBytes alone to the array:
items('For_each')?['contentBytes']
The json in the code view will look like this:
{
"inputs": {
"name": "FilesToMerge",
"valu
...
Copy link to clipboard
Copied
Alright, I solved it; it's not explicitly mentioned in any of the Adobe blog posts or instructions, but the array has to include content type and content in the schema. Here's what my functional Append to Array step looks like:
{
"$content-type": "application/pdf",
"$content": @{items('For_each')?['contentBytes']}
}
Now I just need to add some renaming steps for loading these to Sharepoint, and a condition check to ensure the flow only runs for multiple files. Thanks for putting a second set of eyes on this, it's like pulling teeth trying to get a useful response from Adobe staff.
Copy link to clipboard
Copied
I'm glad you sorted it. I know what it is like trying to figure all this out. I am flubbing my way through this stuff just like you. Well done!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now