File object in Python SDK

回答済み
新規投稿

コメント

2件のコメント

  • jmoldow_box

    Hi,

     

    Many of the Client methods do not make API calls directly. Client.file(), Client.folder(), etc. are examples of this. Instead, they give you an empty object which is configured to make API calls that are rooted at that object. If I wanted to delete a folder, I could call client.file(my_id).delete(). If I wanted to rename it, I'd call client.file(my_id).rename(). In your case, you just want to GET information, so you should do file = client.file(my_id).get(). After that, you should be able to do file.content_created_at.

     

    Whereas Client.search() actually makes the search API call directly, which is why the object you get from there already has the data you want.

    0
    コメントアクション パーマリンク
  • larsenp_lsc

    Thanks. That did the trick. It would be great if the documentation made it a little clearer. Maybe I'm a little thick, but a note or a code sample in the documentation for the file method could make this a lot clearer.

    0
    コメントアクション パーマリンク

サインインしてコメントを残してください。