Skip to main content
Question

SharedLink object is coming null for my shared file !

  • May 21, 2025
  • 2 replies
  • 34 views

Forum|alt.badge.img

BoxFolder folder = new BoxFolder(api, innerItemInfo.getID());
//folder.getItemURL();
Iterator itemInfoItr = folder.iterator();
while(itemInfoItr.hasNext()) {
BoxItem.Info folderItemInfo = itemInfoItr.next();
BoxSharedLink boxSharedLink = folderItemInfo.getSharedLink();
System.out.println("\t\t" +folderItemInfo.getName());
if(boxSharedLink != null){
System.out.println("\t\t" +boxSharedLink.getUnsharedDate());
}

}

2 replies

Forum|alt.badge.img

 If the shared link for an item doesn't exist yet, you will have to create the shared link for that item before getting its value. Here's an example showing how to do this.


Forum|alt.badge.img

I have already created the shared link manually for those files.