cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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: 

Error in call to API function “users/get_current_account”: Unexpected URL params: “access_token”

Error in call to API function “users/get_current_account”: Unexpected URL params: “access_token”

le h.
New member | Level 1

MainViewModel:

 public async Task<string> Httpclient(string link,string oauthToken)
        {    

            HttpClient client = new HttpClient();
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", oauthToken);

            HttpResponseMessage response = await client.PostAsync(link,new StringContent(""));
            response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            return await response.Content.ReadAsStringAsync();
        }

Get_account_ViewModel:

public class Get_Current_Account_ViewModel
    {
        MainViewModel mainViewModel = new MainViewModel();
        public async Task<Model.Get_Current_Account.RootObject> get_current_account(string _accessToken)
        {
            var query = await mainViewModel.Httpclient("https://api.dropboxapi.com/2/users/get_current_account?access_token=_accessToken",_accessToken);
            if (query != null)
            {
                var get_data = JsonConvert.DeserializeObject<Model.Get_Current_Account.RootObject>(query);
                return get_data;
            }
            else
                return null;
        }

I tried on two ways:

  • the first way: I got a problem is

Error in call to API function "users/get_current_account": Unexpected URL params: "access_token" on Dropbox API

at

var query = await mainViewModel.Httpclient("https://api.dropboxapi.com/2/users/get_current_account?access_token=_accessToken",_accessToken);

  • second way: Error in call to API function "users/get_current_account": Bad HTTP "Content-Type" header: "text/plain; charset=utf-8". Expecting one of "application/json", "application/json; charset=utf-8", "text/plain; charset=dropbox-cors-hack". when I remove ?access_token=_accessToken at var query.
  • four way:
  • HttpResponseMessage response = await client.PostAsync(
        link, new StringContent("", System.Text.Encoding.UTF8, "application/json"));    Error in call to API function \"users/get_current_account\": request body: could not decode input as JSON

Please everyone solve this problem. I can not fix it. thanks.

1 Reply 1

Re: Error in call to API function “users/get_current_account”: Unexpected URL params: “access_token”

Steve M.
Dropboxer
Poll
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?
Who's talking

Top contributors to this post

  • User avatar
    Steve M. Dropboxer
What do Dropbox user levels mean?
Need more support?