Hi,
I'm finally at a stage where I manage to create a directory structure in box to mimic what
we had in objective, and I can upload files into box.
But even though I authenticate as an admin user from my script and don't get an error message
for using .as_user( user ) the ownership of uploaded files is systems_internal (shared admin account).
def upload_file(client, target_folder, localFileWithPath, fileName, originalOwner, lastUpdatedBy, dateLastUpdate, boxUser='***number removed for privacy***'):
user = client.user(user_id=boxUser )
root_folder = client.folder(folder_id=target_folder)
a_file = root_folder.upload( localFileWithPath,
file_name= fileName ).as_user( user ).metadata().create({'objective owner':
originalOwner, 'last updated by' : lastUpdatedBy, 'last updated' : dateLastUpdate})
print( a_file )
What am I doing wrong?
Cheers,
Andrej