dropbox api authentication (Error: [400] 'invalid_client')

445 views Asked by At

Following is the the code from dropbox tutorials

from dropbox.client import DropboxOAuth2FlowNoRedirect, DropboxClient
from dropbox import rest as dbrest

    auth_flow = DropboxOAuth2FlowNoRedirect('r********', 'r***********')

    authorize_url = auth_flow.start()
    print ('1. Go to: ' + authorize_url)
    print ('2. Click \'Allow\' (you might have to log in first).')
    print ('3. Copy the authorization code.')
    auth_code = input('Enter the authorization code here: ')

    try:
        access_token, user_id = auth_flow.finish(auth_code)
    except (dbrest.ErrorResponse) as e:
        print('Error: %s' % (e,))

    c = DropboxClient(access_token)

i get the following response

Error: [400] 'invalid_client' Traceback (most recent call last):
File "test2.py", line 17, in c = DropboxClient(access_token) NameError: name 'access_token' is not defined

0

There are 0 answers