Level up your Box knowledge with brand new learning paths on Box University. Visit training.box.com to get started

Shared Link is null

New post

Comments

9 comments

  • Murtza

     What method from our Windows SDK are you calling to share the folder? 

    0
    Comment actions Permalink
  • Box Product Support
    I am not sharing the folder via the SDK, but the folders themselves are already being shared, so when I call the FoldersManager.GetFolderItemsAsync method, the entries' shared_link field is null.
    0
    Comment actions Permalink
  • WimDecorte

    Has there been any resolution on this? I'm running into the same problem: A folder is created and the shared link value is null. The documentation says that the shared link info will be returned when a folder is created.

    0
    Comment actions Permalink
  • Murtza

     You have to call the Create Shared Link endpoint to create a shared link for the new folder. Here's an example in Ruby showing how to do this.

     

    require 'boxr'
    
    client = Boxr::Client.new('ACCESS_TOKEN')
    
    #Create a new folder and print out its item id
    new_folder = client.create_folder("Example Test Folder", "0") #creates a new folder in the user's root directory
    folder_id = new_folder.id
    puts folder_id
    
    #Get information about the new folder. The value for the shared_link property will be nil.
    folder_information = client.folder_from_id(folder_id, fields: [])
    puts folder_information
    
    #Create a shared link for the new folder
    client.create_shared_link_for_folder(folder_id, access: "company", unshared_at: nil, can_download: nil, can_preview: nil)
    
    #Get information about the new folder. The value for the shared_link property will be non nil. 
    folder_information = client.folder_from_id(folder_id, fields: [])
    puts folder_information

     

     

    0
    Comment actions Permalink
  • Michele Sama

    I am having a similar issue. 

    I am trying to programmatically download all shared files but with I list them the shared link is always null even for those files which instead have it. 

    Calling the endpoint to create a shared link is not an option for our use case because the customer is trying to download files that they are manually sharing. 

    0
    Comment actions Permalink
  • Koen bonnet

    Hi all,

    Was this problem solved for you. I also notice this behaviour. I created shared links for a file. I can see it via the user interface while being logged in as the owner. Via the API, logged in via an app user, the field "shared_link" is null. When I log in on the API with the owner account, the field does have the expected value. Apparently it has to do with permissions, but I even made the app user account co-owner on the item.

    Appears to me, that for openly shared links, this fact should be available to anyone with access to the API. Am I wrong?

    Koen

    0
    Comment actions Permalink
  • fvrtests

    Hi, I am have the same issue.

    The share link was created manually after the file was uploaded, via user interface.  When I get file information via API and get some info, but shared_link is null.

    Please help.

     

    0
    Comment actions Permalink
  • Koen bonnet

    Hi, for me the problem was solved. The problem was entirely on my side. No matter if the item is shared entirely public, only users with access to the item get the value via the API. The app you registered to use the api also got a user in Box. You need to give that user access to the shared item. In my case, I had two apps with the same name (one disabled and one active) and I gave the wrong one access.

     

    I hope this helps!

     

    Koen

    0
    Comment actions Permalink
  • Koen bonnet

    Shortly after my own “solved!” message here, I couldn’t reproduce the solution any more. I still think it’s something with permissions, but I don’t get it yet.

    1
    Comment actions Permalink

Please sign in to leave a comment.