404 error when using file/folder id
I have this code:
from boxsdk import OAuth2, Client
CLIENT_ID ='******'
CLIENT_SECRET ='********'
ACCESS_TOKEN = '********'
auth = OAuth2(CLIENT_ID, CLIENT_SECRET, access_token=ACCESS_TOKEN)
client = Client(auth)
This seems to be working fine, when I check who the user is with user = client.user().get() I get my own name. I do have the required permissions to all the files and folders. And when I use the sharedlink for the file in this code:
file = client.get_shared_item(<theSharedLink>)
I am able to retrieve the file information. So I do seem to have the correct access. However, when I use the boxSDK for python and try to use the fileId to retrieve the file, I get a 404 error for some reason:
file_id = '<Id_of_file>
file_info = client.file(file_id).get()
print(f'File "{file_info.name}" has a size of {file_info.size} bytes')
I cannot figure out why my application doesn't have access while me as a user does have the required access to the files/folders. would love some help with this problem as I feel like I'm missing something fairly obvious.
投稿コメントは受け付けていません。
コメント
1件のコメント