Loading a BoxFile Object

回答済み
新規投稿

コメント

4件のコメント

  • bibek_k

    Hello my friend,

     

    You should do more research on your own, read the API documentation before you post questions.

     

    Any way, file object is just for file. To update shared link you should use shared link API:

    for instance:

    curl https://api.box.com/2.0/files/FILE_ID?fields=shared_link \
    -H "Authorization: Bearer ACCESS_TOKEN" \
    -d '{"shared_link": {"access": "open", "password" : "topsecretdoc"}}' \
    -X PUT

    use the FILE_ID that you obtained from the file object.

     

    For more see this link:

    https://developer.box.com/v2.0/reference#get-shared-link

     

    Hope this helps.

    thanks,

    Bibek 

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

    Hi Bibek,

     

    Thanks for your response. Sorry i am new to the API and this is an urgent requirement to set the expiration dates of all our shared links to null. Can you please suggest me solution for this in Java.

     

    Thanks in advance!

     

    Regards,

    Magesh Kumar.

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

    Hi Magesh,

    I do not use Java language but it doesn't matter which language you use. 

    To update the expiration date you should use:

     

    curl https://api.box.com/2.0/files/1234?fields=shared_link \
    -H "Authorization: Bearer ACCESS_TOKEN" \
    -d '{"shared_link": {"unshared_at":"2017-05-30"}}' \
    -X PUT

    This e.g. updates shared link for file id 1234 to May 30 of 2017.

     

    You only need to convert this to Java. Not sure how you are using it (either via plain Java or using Box SDK). But it's pretty much staright forward to do this. 

     

    thanks, 

    Bibek

     

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

    Thanks Bibek. Will work on this further 🙂

     

    Regards,

    Magesh Kumar.

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

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