cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: getting access token via api in unity

getting access token via api in unity

MathanKumar
Explorer | Level 4

Hi i want to get access token via api in unity with UnityWebRequest method. 

 

"https://www.dropbox.com/1/oauth2/authorize?response_type=token&redirect_uri={1}&client_id={0}" how can i get access token using this url in unity.

4 Replies 4

Greg-DB
Dropbox Staff
I recommend first reading the OAuth guide to see how the OAuth app authorization flow works:

https://www.dropbox.com/developers/reference/oauth-guide

The /oauth2/authorize address is a web page, not an API call. You should send the user there in their browser, where they'll be prompted to chooser whether or not to authorize your app.

When using /oauth2/authorize with the "token" flow (i.e., with `response_type=token`), the access token is returned to the redirect URI you specify (via the `redirect_uri` parameter value you supply) on the URL fragment. You should specify a redirect URI that is accessible to your app, so your app can then pull the access token from the URL fragment.

We don't have any resources, e.g., code samples, for Unity in particular, but you can find the full documentation for the OAuth app authorization flow here:

https://www.dropbox.com/developers/documentation/http/documentation#authorization

MathanKumar
Explorer | Level 4

without browser or web browser control it is possible to get access token ?

Greg-DB
Dropbox Staff
No, the OAuth app authorization flow requires a browser. You can store and re-use the resulting access token after the fact though.

MathanKumar
Explorer | Level 4

ok thanks for your information.......

Need more support?