Skip to content

Instantly share code, notes, and snippets.

@salexkidd
Created December 8, 2016 00:27
Show Gist options
  • Save salexkidd/e75054b456dfc59912e5e5f10340cfe0 to your computer and use it in GitHub Desktop.
Save salexkidd/e75054b456dfc59912e5e5f10340cfe0 to your computer and use it in GitHub Desktop.
from boxsdk import (OAuth2, Client)
def get_file_property(file_id):
oauth2 = OAuth2(
client_id="<YOUR CLIENT_ID>",
client_secret="<YOUR CLIENT_SECRET>",
access_token="<YOUR ACCESS_TOKEN>",
)
client = Client(oauth2)
f = client.file(file_id=file_id).get()
print("filename: {} (id: {})".format(f.name, f.id))
print("content_created_at: {}".format(f.content_created_at))
if __name__ == "__main__":
file_id = input("Please input file_id: ")
get_file_property(file_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment