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

Get user who created shared link

Answered
New post

Comments

4 comments

  • anoland

     With the API, you have to run a loop through existing shared links on each file/folder. A faster way would be to use a non-programmatic option by generated a report for shared links (docs here).

    0
    Comment actions Permalink
  • jcerise

     

     

    I noticed the reports contain the user, but unfortunately, I'm using the API.

     

    Can you elaborate on how looping over the shared links would allow me to extract the user that created the link? The data I see on each shared link is:

    {
      "url": "https://www.box.com/s/vspke7y05sb214wjokpk",
      "download_url": null,
      "vanity_url": null,
      "is_password_enabled": false,
      "unshared_at": null,
      "download_count": 0,
      "preview_count": 0,
      "access": "open",
      "permissions": {
        "can_download": true,
        "can_preview": true
      }
    }

     Is there some implied rule that only the owner of the resource can create a shared link on that resource? If so, then I could just get the owner of the resource as the creator of the shared link. But, as far as I've been able to ascertain, co-owner, editor, viewer/editor and viewer can all create links (according to the 'send view only links' perm listed here: https://community.box.com/t5/Collaborate-By-Inviting-Others/Understanding-Collaborator-Permission-Levels/ta-p/144). Having multiple collaborators on a resource makes it impossible to tell which user created the shared link, as the User ID is not included in the shared link data returned via API.

     

    Am I missing something obvious here?

    0
    Comment actions Permalink
  • anoland

     

    The "looping" I referred to is multi-part. By using events, you could look at up to a year's worth of events, including those listed as "ITEM_SHARED_CREATE". Moving forward, you could also set up logging from this event for scripted reporting/auditing. 

     

    The event will have a `created_by` field which refers to who "created"/triggered the event.

     

     

    0
    Comment actions Permalink
  • jcerise

    That is a very workable solution. Thanks so much for the prompt replies !

    0
    Comment actions Permalink

Please sign in to leave a comment.