Welcome to the new Box Support website. Check out all the details here on what’s changed.

Get SharedLink Info using the Java SDK

New post

Comments

2 comments

  • kendomen
    private static BoxSharedLink createSharedLink(BoxAPIConnection api, String fileId) {
            BoxFile file = new BoxFile(api, fileId);
            BoxSharedLink.Permissions permissions = new BoxSharedLink.Permissions();
            permissions.setCanDownload(true);
            permissions.setCanPreview(true);
            Date date = new Date();
    
            Calendar unshareAt = Calendar.getInstance();
            unshareAt.setTime(date);
            unshareAt.add(Calendar.DATE, 14);
    
            BoxSharedLink sharedLink = file.createSharedLink(BoxSharedLink.Access.COMPANY, unshareAt.getTime(), permissions);
            logger.info("shared link: " + sharedLink.getURL());
            return  sharedLink;
        }
    0
    Comment actions Permalink
  • Box Product Support

    Thanks for the reply.

    Perhaps my question needs clarification - 

    I already have an existing id of an existing shared link.

    I'd like to get info of that shared link.

    Is that possible?

    0
    Comment actions Permalink

Please sign in to leave a comment.