We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

AdnanL's avatar
AdnanL
Helpful | Level 5
3 years ago

How can I solve this error: Property 'refresh_token' does not exist on type 'object'?

Hello,

I am trying to make a replica in Typescript of the Dropbox webhook (that converts md files to html) that was built in Python. I copy-pasted the authentication flow from this example and I had to change a few things along the way till I reached this error that I couldn't solve.

Here is a screenshot:

The documentation of the SDK are quite poor they didn't help at all.

Thanks in advance.

  • AdnanL Thanks. That output looks correct and should allow the code to get the "token.result.refresh_token" value. When you say you "did not run the script before I posted this issue", do you mean that when you originally posted this and said you "reached this error that I couldn't solve", that was only a warning you saw in your IDE, and not an error occurring during execution? It sounds like this was just a TypeScript type warning, and not something preventing this code from running properly. Is that correct?

     

    By the way, for future reference, do not post your full access or refresh token values like this. I've redacted them from your screenshot now.

    • Greg-DB's avatar
      Greg-DB
      Icon for Dropbox Staff rankDropbox Staff

      AdnanL Yes, as Здравко requested, it would probably be helpful if you indicated what you're getting in the log. As a matter of security though, please don't share any actual full access/refresh token value.

       

      It would likely also be helpful if you could share some more context, such as:

      • the rest of the relevant you're running for the authorization flow; you linked to the example you're working from but you mentioned you had to change a few things
      • the version number of the Dropbox SDK you're using
      • the name and version number of whatever platform you're using, etc.
    • AdnanL's avatar
      AdnanL
      Helpful | Level 5

      Thanks for the replies,Greg-DB Здравко

       

      This is all the code in my file: https://www.toptal.com/developers/hastebin/basayuhope.typescript, what I am trying to do is to attack dropbox accounts to my dropbox app (A replica of the webhook example by dropbox).

       

      I am using Node.js 16.13.1 with Dropbox version 10.24.0, the API was different from the example so I had to create a new instance of the DropboxAuth class and change some function names and alter some parameters that were passed to the functions, no big deal.

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        AdnanL Thanks for following up. Can you indicate what you're getting in the console though? Specifically, the "Token Result" value being logged on line 53 from the code you shared. Please don't show actual full access/refresh token values however.