I am trying to build an app that automatically updates files every minute from my server PC to dropbox API using the python app. But after 4 hours, it gives an expired token error. what I do is go to the token URL and click on allow button, copying refresh token, and use this in my code to get access token and work using it and to implement if condition to check if the response shows an error of expired token then again requests a new access token using refresh token that received in the previous response. Here is my code in Github. Please check if there is any mistake.
Solved! Was doing a little mistake!