新しいBoxサポートサイトへようこそ。 変更点の詳細はこちらをご確認ください .

Box API Thumbnail Image for Documents

新規投稿

コメント

2件のコメント

  • SofiaLearn

    Any news on this? same goes with box-node-sdk, in Crocodoc you used to have a thumbnail for documents, in this api you don't seem to have one?

     

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

    See this https://codepen.io/box-platform/pen/WEwXQy

     

    What they do instead is generate representations for files, you can get them here

    https://developer.box.com/v2.0/reference#representations

     

    Then based on the available type (png or jpg) and available resolution (1024x1024) you can do a request to the info.url to trigger boxview to generate that image, you can then proceed to call representations again but with the X-Rep-Hints header specifying the type and resolution that you want, it will give you a content object with a url_template variable, where you replace the {+asset_path} part of the string with the page number that you want, for example for a png at 1024x1024 and page 1 you would replace it with 1.png

     

    you need to call it while passing the auth header like so, adding the token as a parameter in the url will make it all not work.

    Authorization: Bearer ACCESS_TOKEN

     

    convoluted, but I got it to work in php 🙂

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

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