I am trying to create a shared link from a not root box folder by Java SDK using an enterprise account credential.
log.info("Start createSharedLink. id: {}, canDownload: {}, canPreview: {}", id, canDownload, canPreview);
BoxFolder folder = new BoxFolder(boxProvider.getConnect(), id);
BoxSharedLinkRequest boxSharedLinkRequest = new BoxSharedLinkRequest()
.permissions(canDownload, canPreview)
.access(BoxSharedLink.Access.COLLABORATORS)
.unsharedDate(Date.valueOf(LocalDate.now().plusDays(3)));
BoxSharedLink sharedLink = folder.createSharedLink(boxSharedLinkRequest);
log.info("End createSharedLink. Created Url is: [{}]", sharedLink.getURL());
This request can work when I use either of following"
BoxSharedLink.Access.COMPANY
BoxSharedLink.Access.DEFAULT
BoxSharedLink.Access.OPEN
But only when I use COLLABORATORS, it will return me a 400 error
com.box.sdk.BoxAPIResponseException: The API returned an error code [400 | fuamn7hnyquow1er.03b4659d0dee504972e2e4896a16876e6] bad_request - Bad Request
There is no specific information here explained what I am missing.
Does anyone know what is wrong here or how to solve?