Once you get the token place it in the OAuth object.
Make sure you do not use any of the old authentication methods, you can remove this line completelyfor e.g.
Code:
tokenLink = "https://api.dropbox.com/0/token?"
Also change the API version on *ALL* the links from 0 to 1:
Code:
metadataLink = "https://api.dropbox.com/0/metadata/dropbox"
to
Code:
metadataLink = "https://api.dropbox.com/1/metadata/dropbox"
If you still encounter errors you will have to provide more information, like that error/response you get in the logs.