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

box cli search and using --ancestor-folder-ids

New post

Comments

4 comments

  • jcleblanc

    Hi ,

     

    This is most likely due to the access token not being scoped for the user that owns the folder IDs that you're specifying. If that's the cause, basically you're making calls on behalf of an account (e.g. the service account) when they don't have permission to the folders that you're specifying. 

     

    If you run a box users:get me call you can see the account that the token is scoped for. Make sure that the folder IDs you've specified is ancestor-folders-ids are owned by that user or that the user has been collaborated in on those folders to permit them to search. 

     

    An easy way to check if the user has access is to run box:folders get ID. If you get a 404 then that's the issue. 

     

    Thanks,

    Jon

    0
    Comment actions Permalink
  • kendomen

    I think that's why I'm confused.  I can get box folder:get xxxxx

    the other thing is I have GAC enabled for this app with enterprise scope and all permissions enabled.

    0
    Comment actions Permalink
  • kendomen

    Ok I'll try to add the automationUser as a collaborator to the folder. 

    0
    Comment actions Permalink
  • kendomen

    So taking out ancestor-folder-id and doing something like this might be the solution since i get results from this.

     

    box search xxxx --scope enterprise_content --content-types files --fields name,path_collection | jq '.[] | select(.path_collection.entries[1].id == "xxxxxx")'

    0
    Comment actions Permalink

Please sign in to leave a comment.