HTTP: I want a PDF (Buffer, codepage:binary) but get Data as a Long String

I’m using a Make Module to Export Invoices as PDFs from a Software and upload them somewhere else. I need to do the same for Quotes and Offers, but there is no finished module i could use to get the files, so i’m trying to get them via a HTTP request as it is defined in the API Documentation of the software I’m working with.

With the prebuild module my process looks like this:

This is the data i get from the “get a pdf” module:
image

The next prebuild module (from a different company/software) realized what i want to upload and gives me the option to do so:
image


With the http request it’s different. The Data i receive is a Long String as shown here in the Documentation:


Is there a way to convert this Long String into binary so i can hopefully upload it.
(When i upload the Long String i get a data set, but no actual copy of the pdf)

Welcome to the Make community!

That looks like a base64 encoded string.

Try using the built-in function toBinary and toString with the appropriate second parameter.

For more information, see https://www.make.com/en/help/functions/string-functions#tobinary--value-

samliewrequest private consultation

Join the unofficial Make Discord server to chat with us!

2 Likes

Thanks for Answer!

I managed to get this instead of no pdf at all which is something.

I guess i have to go to talk to the support of both apis and maybe make it work somehow as i currently have no way of converting the data back into its originial pdf, i think.

Try using it like this:
image
This should create a binary data. With those data you can upload it to your desired tool.

2 Likes

it finally worked, thank you so much

i could swear i tried it exactly like this but i never managed.
Setting up the scenario from scratch now and it suddenly worked.
must have had something in there were i mapped the wrong thing last week