What's Causing an Error in My Dropbox Access Token Retrieval Script?

96 Views Asked by At

I'm trying to create a script to get a data file from Dropbox. I'm using the code below to obtain a Dropbox access token, but it's not working and gives me an error. What could be the issue?

function createDropboxOAuth2Service() {
  return OAuth.createService('Dropbox')
    .setAuthorizationBaseUrl('https://www.dropbox.com/oauth2/authorize')
    .setTokenUrl('https://api.dropboxapi.com/oauth2/token')
    .setClientId(DROPBOX_APP_KEY)
    .setClientSecret(DROPBOX_APP_SECRET)
    .setPropertyStore(PropertiesService.getUserProperties())
    .setCallbackFunction('authCallback')
    .setScope('files.content.read');
}

It's not working and always shows an error.

enter image description here

0

There are 0 best solutions below