cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you new to Dropbox? Our Newcomers group is the perfect place to learn the basics, find out more 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: 

Missing query parameter 'responseUri'

Missing query parameter 'responseUri'

Tomtit
Explorer | Level 3

I making MVC application and trying to refresh token.

 

 

const string redirectUrl = "https://www.dropbox.com/1/oauth2/redirect_receiver";
           // string oauthUrl = $@"https://www.dropbox.com/1/oauth2/authorize?response_type=token&redirect_uri={redirectUrl}&client_id={AppKey}";
            
            string oauth2State;
            oauth2State = Guid.NewGuid().ToString("N");
            Uri authorizeUri =  DropboxOAuth2Helper.GetAuthorizeUri(OAuthResponseType.Token, ApiKey, redirectUrl, state: oauth2State);

            OAuth2Response tokenResult = await DropboxOAuth2Helper.ProcessCodeFlowAsync(authorizeUri, ApiKey, ApiSecret,null,oauth2State);
           

 

End getting error: The responseUri is missing a code value in the query component

2 Replies 2

Здравко
Legendary | Level 20

@Tomtit, Would be much easier if you start with some simple test code (something like shown here). 🙂 Once you got it running, you can play with different code modifications there.

It's more automated when redirect URI points to local address rather external one for standalone local application. In referred example such URI is calculated here and is "extended" from local host (defined little above). The same URI (i.e. http://127.0.0.1:52475/authorize for particular example) should be registered for your application to be acceptable for Dropbox (security measure). As you can see in the example, authorizeURI (generated here) is used for launching your system browser rather than processing with API further (i.e. it's web address, not a API call or parameter of such call). In your post you are trying incorrect processing in the same context! The result from link confirmation (made by hand) gets received as a result of redirect handling (in the particular example in 2 steps - in HandleOAuth2Redirect and HandleJSRedirect functions bodies). 😉

Hope this gives direction.

Greg-DB
Dropbox Staff

@Tomtit Like Здравко said, I also recommend starting with an unmodified sample app to see that working first, before making changes or implementing your own.

 

Anyway, as they pointed out, your code that you shared here is incorrect because it is passing the authorization URL itself to ProcessCodeFlowAsync. That won't work because the authorization URI is the location of the web page where the user needs to manually authorize the app once. It's the resulting redirect URI (containing the authorization code) that you should pass to the responseUri parameter of ProcessCodeFlowAsync, like I described in your other thread. (Alternatively, you can pass just the authorization code string as the 'code' parameter.)

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?