Learn how to make the most out of the Dropbox Community here 💙. 

Forum Discussion

isaacfink's avatar
isaacfink
New member | Level 2
2 years ago
Solved

No auth function available for given request js sdk

I am using the js sdk like this     const client = new dropbox.Dropbox({ accessToken: config.accessToken, clientId: config.appKey, clientSecret: config.secretKey, }); dbx.auth.setRefres...
  • Greg-DB's avatar
    Greg-DB
    2 years ago

    This looks correct. I also just tried this all myself and it worked successfully for me. (Setting refreshToken on dropbox.Dropbox and also calling setRefreshToken is redundant, but it shouldn't cause this issue as long as you're using the correct value.)

     

    Please double check that you have copied in all of the values correctly, and didn't accidentally modify, misplace, or omit any of the values. For instance, your code here doesn't show how 'config' is set, so I can't replicate that exactly. I suggest printing out each each config value before you use them so you can check them.

     

    For instance, make sure:

    • 'config.appKey' is the same as the 'client_id' in the /oauth2/authorize URL that resulted in the authorization code
    • 'config.secretKey' is the app secret that corresponds to the app key in 'config.appKey'
    • 'config.appKey' is the same as the 'client_id' used in the /oauth2/token call
    • 'config.secretKey' is the same as the 'client_secret' used in the /oauth2/token call
    • 'config.refreshToken' is exactly the 'refresh_token' returned by /oauth2/token, and is a different string than each of the app key, app secret, access token, and authorization code

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers809 PostsLatest Activity: 7 days ago
224 Following

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 or Facebook.

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!