cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

REST POST a file to box.com

craig_williams
New Contributor

Hi, Iโ€™m trying to do a multi-part form REST Post to box.com upload API which requires a file and an attributes part. Weโ€™re getting an error indicating that the parent parameter canโ€™t be found. Parent is essentially the folder id in Box. The box API says the call would be sent like so:

curl https://upload.box.com/api/2.0/files/content
-H โ€œAuthorization: Bearer ACCESS_TOKENโ€ -X POST
-F attributes=โ€˜{โ€œnameโ€:โ€œtigers.jpegโ€, โ€œparentโ€:{โ€œidโ€:โ€œ11446498โ€}}โ€™
-F file=@myfile.jpg

Hereโ€™s the sample pipeline Box REST POST_2018_08_29.slp (8.6 KB)

In this iteration Iโ€™m creating the attributes as an expression and passing it into the HTTP entity element in the REST POST Snap. Iโ€™m not sure how else to pass these attributes data elements to the REST POST call. I feel like Iโ€™ve tried everything but box.com doesnโ€™t seem to see the parent attribute which is necessary for the call to succeed. Admittedly, Iโ€™m a bit new to using the REST snaps, but hoping someone could throw out some ideas to try. Thank you!

Craig

5 REPLIES 5

Lidiya_Thomas
New Contributor II

Hi @craig.williams were you able to do so?

Even I am getting the same error.

I tried with Box write snap too but I am not able to still write to Box, the file that gets written is unreadable. I was able to write to Box using rest call through Postman.

Please let me know. Thanks.