
Question
Preview Link Opens Window with Print and Download Buttons Disabled, Shared Link Returns a 403
Hi All,
Is anyone else having these issues?
Creating a preview link with the API:
BoxAPIConnection api = new BoxAPIConnection(accessToken);
BoxFile file = new BoxFile(api, fileId);
URL url = file.getPreviewLink();
Results in an HTML page with the download and print buttons hidden:

Creating a shared link with the API:
BoxAPIConnection api = new BoxAPIConnection(accessToken);
BoxFile file = new BoxFile(api, fileId);
Permissions permissions = new Permissions();
permissions.setCanDownload(true);
permissions.setCanPreview(true);
String url = file.createSharedLink(Access.OPEN, null, permissions).getURL();
Results in:
com.box.sdk.BoxAPIException: The API returned an error code: 403
null
at com.box.sdk.BoxAPIResponse.(BoxAPIResponse.java:85) ~[box-java-sdk-2.8.2.jar:na]
at com.box.sdk.BoxAPIRequest.trySend(BoxAPIRequest.java:477) ~[box-java-sdk-2.8.2.jar:na]
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:265) ~[box-java-sdk-2.8.2.jar:na]
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:240) ~[box-java-sdk-2.8.2.jar:na]
at com.box.sdk.BoxFile.updateInfo(BoxFile.java:489) ~[box-java-sdk-2.8.2.jar:na]
at com.box.sdk.BoxFile.createSharedLink(BoxFile.java:157) ~[box-java-sdk-2.8.2.jar:na]
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.