box cli search and using --ancestor-folder-ids
When I use box cli search with --ancestor-folder-ids, I get a 404
box search xxxx --scope enterprise_content --content-types files --ancestor-folder-ids xxxxxxxx | jq '[limit(3;.[] | select(.name | contains("xxxxx")))]'
Unexpected API Response [404 Not Found | nku76jg8iy92083s.06c47f7fd3799a7db01040e00762bb10] not_found - Not Found
When I take out --ancestor-folder-ids, i get back results. Is there a known bug?
thanks!
-
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
Please sign in to leave a comment.
Comments
4 comments