We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
asharma327
7 years agoNew member | Level 2
Get User ID from Chooser API
In my app, I am using the OAuth properly and am able to interact with a user's file (read, write etc). My flow is currently:
1. Get access_token by having the user allow the app access to their acc...
- 7 years ago
No, I'm afraid there isn't anything quite like that either. (The Chooser wasn't originally designed to be used together with the API, so there isn't much interoperability.)
There are a few ways you can try, though they're not ideal and won't be 100% reliable for this:
- Once you have the file ID, try calling /2/files/get_metadata with the file ID using each of the access tokens you have. If the account has access to the file, you'll get the metadata back. If not, you'll get an error.
- Once you have the shared link, try calling /2/sharing/get_shared_link_metadata with the shared link using each of the access tokens you have. If the link owner is a team member of the same team as the connected account for that access token, `team_member_info` will be set.
asharma327
7 years agoNew member | Level 2
Ah shucks :(
Per chance, is there any way to get the user info from the file info? For example, maybe get the account ID from the file ID or file link from another API endpoint?
Greg-DB
Dropbox Community Moderator
7 years agoNo, I'm afraid there isn't anything quite like that either. (The Chooser wasn't originally designed to be used together with the API, so there isn't much interoperability.)
There are a few ways you can try, though they're not ideal and won't be 100% reliable for this:
- Once you have the file ID, try calling /2/files/get_metadata with the file ID using each of the access tokens you have. If the account has access to the file, you'll get the metadata back. If not, you'll get an error.
- Once you have the shared link, try calling /2/sharing/get_shared_link_metadata with the shared link using each of the access tokens you have. If the link owner is a team member of the same team as the connected account for that access token, `team_member_info` will be set.
- asharma3277 years agoNew member | Level 2
Gotcha, I was thinking of doing something along those lines. Thanks Greg
About Discuss Dropbox Developer & API
Make connections with other developers
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!
Related Content
- 4 years agoanonymous