Hello,
I'm calling a Google Gmail API to get the attachments of an email, with an Integration. The attachment comes in a form of a base64 document inside the body:
"body": { "size": 1111, "data": "base64_document_here" }
I tried to get an attachment with 12KB (around 12k characters) and it works great...
until I use the "Convert base64 values to Appian documents" checkbox:
I've also tried to get a smaller attachment and it seems to be working just fine:
I think it may have to do with Appian trying to convert the JSON into a CDT first, which looks like it's limiting the size to 4000 characters, and then decoding the base64, but I'm not sure.
Has anyone ever had this problem before?
Discussion posts and replies are publicly visible
A single integration call can handle up to 75mb of documents: https://docs.appian.com/suite/help/23.4/Integration_Object.html#limits
What does the response body look like for the first screenshot, where you are getting the 12k document without the checkbox checked? Or similarly, if you use an external tool such as Postman
Hello Steve, thanks for you answer.
Below I'll put a screenshot of the response of the 16k (it's not 12k, my mistake from the original post) document without the checkbox:
.
Not sure if this matters, but if I ask to return the raw response body:
The body structure looks right. When converting to Appian value, base64 strings are only truncated to 4,000 characters if they are not mapped in the configuration grid, which you had correctly. Any more details arise from further tests, the logs, or the http request/reponse logs?
Hi, I am facing similar issue and found no way to save attachments in appian by using appian "Convert base64 values to appian documents". need help or a better solution. in case of outlook attachment integration api its working perfectly fine.
Hello, I found a solution for my problem:
For some reason, Google API base64 documents are not compatible with Appian from base64 values to documents.
My solution was to save the base64 value that came from Google API, in a constant, and use it in an internal Web API with one twist:
substitute( substitute(cons!GOOGLE_DOC_BASE64, "-", "+"), "_", "/" )
Replacing the - with + and the _ with / solves this issue when calling my new internal Web API, with the "Convert base64 values to Appian documents".
Wow this is great troubleshooting. First off, I'd recommend opening a support case to help determine why the base64 from the gmail integration isn't working with the Appian Integration Object.
The workaround is really creative, and I would just have one tweak. If using a single constant, I think you will encounter race condition issues if two documents are processed at the same time. To populate the constant, I also imagine you are storing the base64 in process variable memory which you'll want to avoid if possible.
Since you are already using an Appian Web API in the workaround, I'd recommend placing the call to the Integration Object directly in the Web API before doing the substitute. This will solve for concurrent document processing and also keep the base64 out of process variables.
For the workaround, even if using raw response value, you will be subject to the 5MB limit on Integration Object response body, meaning you could not retrieve documents where the base64 representation is larger than this. This is another reason why I'd recommend creating a support case to investigate.
Thanks for the tips! Indeed, calling the Integration directly in the Web API saves some memory and some nodes on the process model.
I'll try to follow with a support case so Appian can investigate this issue.