box / box-python-sdk

Box SDK for Python
http://opensource.box.com/box-python-sdk/
Apache License 2.0
418 stars 215 forks source link

Created folder through boxsdk not showing in the app.box.com web interface #773

Closed bmsan closed 1 year ago

bmsan commented 1 year ago

Description of the Issue

Using the box-python-sdk I have created a folder under the root("0") parent. Running the script again I can see that the folder was indeed created. (and it's id is consistent with the previous run).

Going to the web interface https://app.box.com/folder/0 I do not see that folder created. I've also tried accessing https://app.box.com/folder/folder_id_returned_by_boxsdk but it tells me Oops! We can't seem to find the page you're looking for.

I'm logging in using App Token (Server Authentication). I am using the OAuth2 function and setting only the access_token.

Steps to Reproduce

from boxsdk import OAuth2, Client

def get_create(client, folder_name, parent="0"):
    for item in client.folder(parent).get_items():
        if item.name == folder_name:
            return item.id
    return client.folder(parent).create_subfolder(folder_name).id

auth = OAuth2(
    client_id=None,
    client_secret=None,
    access_token="your_actual_token_here", # <- add a valid token here
)
client = Client(auth)

user = client.user().get()
print(f"The current user ID is {user.id}")

folder_id = get_create(client, "new_folder")
print(folder_id)
antusus commented 1 year ago

Hello @bmsan, App Tokens authorise application to work in a Service Account space which is separated from the user space. That is why you cannot see the folder in your account. App Tokens If you did follow those instructions there is no way of sharing this folder with any user. You would need JWT (or CCG) account to do that.

bmsan commented 1 year ago

@antusus thanks ! Indeed those were the steps I followed.

Thank you for the clarification !