Level up your Box knowledge with brand new learning paths on Box University. Visit training.box.com to get started

Python BOXSDK JWTAuth 404 error when trying to upload file

Answered
New post

Comments

1 comment

  • eallan

    Fixed the error I was getting by adding myself as a user to the account (since I am not the owner). I used the following code:

    oauth = JWTAuth(
                    client_id='xxxxxxx', 
                    client_secret='xxxxxxx', 
                    enterprise_id='xxxxxxxx',
                    jwt_key_id='xxxxxx',
                    rsa_private_key_file_sys_path='xxxxxxx.pem',
                   )
    access_token = oauth.authenticate_instance()
    from boxsdk import Client
    client = Client(oauth)
    ev_user = client.user(user_id='***number removed for privacy***')
    ev_auth = JWTAuth(
                    client_id='xxxxxxxx', 
                    client_secret='xxxxxxxx', 
                    enterprise_id='xxxxxxxx',
                    jwt_key_id='xxxxxxxx',
                   
    rsa_private_key_file_sys_path='xxxxxx.pem',
                   )
    ev_auth.authenticate_app_user(ev_user)
    ev_client = Client(ev_auth)
    shared_folder = ev_client.folder(folder_id='***number removed for privacy***0')
    0
    Comment actions Permalink

Please sign in to leave a comment.