Expand my Community achievements bar.

Join us LIVE in San Francisco on November 14th for Experience Makers The Skill Exchange. Don't miss out on this free learning event!

Upload Documents via API using Postman

Avatar

Level 2

Hi,

I am attempting to upload multiple Documents via Postman via the API. Does anyone have any code examples or documentation on how to do this? I've been able to GET project details and even POST New Projects via the Postman but haven't figured out the upload API yet. Any assistance or advice would be greatly appreciated!

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

6 Replies

Avatar

Level 3

To upload via Postman you need to use the form-data option with the key uploadedFile like in the screenshot attached, the Value field will change to Select Files.0694X00000I8u8cQAB.pngHope this helps you out.

Avatar

Level 2

Thanks Andy. Is there a way to upload, for example 12 files and associated custom field data for all those 12 files, all within an attachment in the body? I understand you can upload 1 file at a time with your Postman instructions above but is there way to upload X amount of files and their associated custom data all within one file attached in the Body?

Avatar

Level 3

Hi Noah,

Not that I've found using Postman as it only return a single handle for the upload and not an array 😣 which would be easier to parse.

I had to build a mac desktop application which does exactly this for our company which uploads multiple files, moves files to associated Project/Tasks, adds user time to the task and can attach a custom form to the document, this might be the better way to go if your able to do it or you can do it if you have Workfront Fusion.

If you need to get the handle of the upload in Postman you can use the following, put it under the Tests tab, create an environment variable called handle.

var jsonData = JSON.parse(responseBody);

postman.setEnvironmentVariable("handle", jsonData.data.handle);

I only use Postman for development so I can get my code calls right.

Sorry I couldn't be any more help for you.

Avatar

Level 2

Thanks Andy! Appreciate the insights.

Yea, I'm in the process of building an app for bulk updates to Workfront docs so I think I've almost figured out a solution for my org.

Right now I'm using sending the updates via the URL parameters using the 'updates' action on the document object. It's working great when I'm only updating fields on say 5 documents. But when I try to update 25 or so (still trying to figure out the exact number) documents, it fails out.

0694X00000I9PITQA3.pngDo you know if there is a limit to the number of documents you can update at a time? Couldn't find anything in the documentation. Thx!

Avatar

Level 3

Hi Noah,

Try adding your updates JSON under the body tab as raw and JSON, disable the updates key under Params, that should work for multiple updates.

Avatar

Level 2

Thanks Andy! Changed my HTTP request per your advice and works like a charm now. Appreciate the help.