Box.com Embedded File / Folder View code via api

Looking for a way to get the embed code for Box files through the API.

We have included Box in our application, and a new built-in file / folder viewer . I would like to give people the opportunity to view their files / folder in our application using the embed option, but you need a way to get the embed code

for example: https://www.box.com/embed/{file reference}.swf

Thanks for any info,

Dan

+4
source share
4 answers

I am currently using v1 API's CreateFileEmbed http://developers.box.net/w/page/50509454/create_file_embed

Update [September 2013]

Box released the public beta of the View API at http://developers.box.com/view/

This is another HTML5 viewer for.

+2
source

EDIT: v2 Insert Folder (requires user to log in)

 <iframe src="https://box.com/embed_widget/000000000000/files/0/f/#{@folder.id}?view=expanded&sort=name&direction=ASC&theme=blue" width="100%" height="800" frameborder="0"> </iframe> 

Folder insertion code is not currently supported.

See the Dev team comments at the bottom of this publication http://developers.blog.box.com/2012/10/11/even-more-v2-updates/

+4
source

The documentation and support for the boxes are terrible. Here is what I understood:

 # given you have your box file in a variable named "file": result = file.api.file_embed(file.id) # this may throw Box::Api::NotShared embed_html = result['file_embed_html'] if result.respond_to?(:[]) 

Unfortunately, you must first share the file. There seems to be no way to make private domains in the API from what I found, except through email (wtf?).

For completeness, shares can be done using api, for example: (note that the file.unshare method [at the time of writing] is broken, so the call through file.api is broken)

 file.share_public file.api.unshare_public(file.type, file.id) 
+1
source

It may be out of date, but this work works for me.

First share the file or folder with api, then extract the shared_link and later join the embed url ( https://app.box.com/embed_widget/000000000000/s/SHARED_LINK_VALUE ).

See: Creating shared folders Creating shared files Insert files or folders

0
source

Source: https://habr.com/ru/post/1438855/


All Articles