Copy link to clipboard
Copied
I am having trouble figuring out how to send a pdf file to the /transientDocuments REST API. In what format should it be in? what do I need to include in the headers and body? I can never find a clear answer.
I figured it out! I will post the solution for others looking.
In order to send a pdf over HTTP /POST, I set the header to have the access token. However, I set the body to be
"-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"File\"; filename=${fileBase64}\r\nContent-Type: application/pdf\r\n\r\n\r\n-----011000010111000001101001--"
Where the 'fileBase64' variable is my file that I converted into a Base64 string.
I also set the Content-Type to be "multipart/form-data; bounda
...Copy link to clipboard
Copied
I figured it out! I will post the solution for others looking.
In order to send a pdf over HTTP /POST, I set the header to have the access token. However, I set the body to be
"-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"File\"; filename=${fileBase64}\r\nContent-Type: application/pdf\r\n\r\n\r\n-----011000010111000001101001--"
Where the 'fileBase64' variable is my file that I converted into a Base64 string.
I also set the Content-Type to be "multipart/form-data; boundary=---011000010111000001101001"
I was able to figure it out by using Postman application to observe what was sent between the Adobe server and the application. Postman also had sample code in Java (and many other languages) that proved to be invaluable when I was trying to figure out a solution.
Hope this helps someone else.