Hey!
I wrote the following code with the Python SDK:
from boxsdk import DevelopmentClient
client = DevelopmentClient()
items = client.folder(folder_id='0').get_items()
for item in items:
print('{0} {1} is named "{2}"'.format(item.type.capitalize(), item.id, item.name))
After I entered the token, I got a success response:
GET https://api.box.com/2.0/folders/0/items {'headers': {'Authorization': '---crqY',
'User-Agent': 'box-python-sdk-2.12.0',
'X-Box-UA': 'agent=box-python-sdk/2.12.0; env=python/3.9.4'},
'params': {'offset': 0}}
"GET https://api.box.com/2.0/folders/0/items?offset=0" 200 456
{'Date': 'Tue, 18 May 2021 22:58:38 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000', 'Cache-Control': 'no-cache, no-store', 'Content-Encoding': 'gzip', 'BOX-REQUEST-ID': '09f109ee5db0ffa8a1cbf9985ffcb9adb'}
{'entries': [{'etag': '0',
'id': '137623996023',
'name': 'afc_permenant',
'sequence_id': '0',
'type': 'folder'},
{'etag': '0',
'id': '137623898981',
'name': 'afc_upload_batch_16114961890_0_1621372798_b5e379e6-fe62-4f8a-bf89-d2941814d077',
'sequence_id': '0',
'type': 'folder'},
{'etag': '0',
'id': '137626139913',
'name': 'My Stuff',
'sequence_id': '0',
'type': 'folder'}],
'limit': 100,
'offset': 0,
'order': [{'by': 'type', 'direction': 'ASC'},
{'by': 'name', 'direction': 'ASC'}],
'total_count': 3}
Folder 137623996023 is named "afc_permenant"
Folder 137623898981 is named "afc_upload_batch_16114961890_0_1621372798_b5e379e6-fe62-4f8a-bf89-d2941814d077"
Folder 137626139913 is named "My Stuff"
However, I don´t have these files in my box. I don't know why I'm receiving that info. Perhaps I have to add some lines in order to define the target.
Could you give me some advices, please?
Thanks.
Hernan M


