1.How to check if access token has expired? For the moment I created a new DropboxClient and if it is null I make a new request for another access token.
2.Is it possible to get the parent id of a folder or file? I've seen that every metadata of a file or a folder has an id , but they don't have a parentId.
3.Why can't I make a request for a token without redirect_uri? In documentation it apears to be optional , but when I pass it as null to GetAuthorizeUri() method it crashes because redirect_uri is null in a token request (https://api.dropboxapi.com/1/oauth2/token).
Access tokens don't expire, but they can be invalidated by a user who revokes your app's access. To test an access token, just make an API call and handle the exception for a 401 response. I'm not sure what null value you're checking for, but nothing client-side will tell you if the access token is valid; you need to test it by calling a server-side endpoint.
I assume you're asking about the file IDs in API v2, right? I think you'll need to use the path to determine the parent and call get_metadata on the parent to get its ID. (E.g. if the path is /foo/bar/baz, call get_metadata on /foo/bar.)
Per the OAuth 2 spec, the redirect_uri passed to /token has to match the one used with /authorize, so if you used one there, then you need to use one when you call /token. I believe this requirement is for security purposes, though I'm not 100% sure what security threat it mitigates.
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?