Auto create shared links
Is there a way to auto create shared links for documents in a folder? I know that I can create a single shared link to the folder. But what I need is individual shared links for 1000 pdfs in a folder. I can then run a shared link report as the admin and along with the document name create hyperlinks to all the documents in a single PDF index for use with anyone who doesn't have a Box account. Right now I am clicking each file individually and then clicking "create and copy shared link" and it is taking forever. Any help would be appreciated!
-
Hi there,
Welcome to the Box Community!
Unfortunately, we don't currently offer the feature you asked to auto create shared links for documents in Box, you will have to manually create or enable them as stated in this article:If this is something you would like to be able to do, I would highly recommend submitting this feature request at pulse.box.com! Our product managers review these requests and take them into consideration for future product development.
Best,
-
Hi there, just to follow up on this. I built an internal company tool that can auto-generate PDF documents and upload them into a box folder and some of these files will be shared with external users. So when I upload any document via the API, do I have to run a second API to enable sharing of that document I just uploaded? In other words: step 1 - upload using the /files/content/ endpoint, and then step 2 - share using the /files/:file_id?fields=shared_link endpoint with a PUT verb?
In/files/content/files/contentIn the API example for the upload (https://developer.box.com/reference/post-files-content/), there is a sample response that includes the shared_link section. I looked through the attributes description but there is no reference to creating a shared link at the same time when uploading the file.
I thought maybe something like the following would work in the attributes request body:
{
"name": "Sample_Doc.pdf",
"parent": {
"id": "123456789012"
},
"content_created_at": "2023-02-19T10:53:43-08:00",
"content_modified_at": "2023-02-19T10:53:43-08:00"
},
"shared_link": {}But that only caused a 400 Bad Request error or did not result in anything in the shared_link object. The "shared_link": {} syntax can be used in my referenced step #2 above to just use all the defaults. I did try a few variations on the above.
David
-
I have exactly the same problem.
Looking at the "upload file" api this seems to be possible because in the sample response the "shared_link" section is populated with the link.
So, I'd expect a way to enable the have the shared link enable when uploading the file in order to get it in the response.
Please sign in to leave a comment.
Comments
3 comments