Box v0.2.3 Box View Source
Unofficial Box SDK for Elixir. See the BoxOAuth2 module to get started.
Link to this section Summary
Functions
Create folder in a parent folder.
Create shared link for a file.
File from path returns the file name and id for a path in Box.
File info for a file id.
Folder from path returns the folder id for a path in Box.
Folder items returns the entries in a folder.
Upload a local file to a folder on Box.
Link to this section Functions
Link to this function
create_folder(client, name, folder_id) View Source
Create folder in a parent folder.
{:ok, folder} = Box.folder_from_path(auth.client, "/")
{:ok, response} = Box.create_folder(auth.client, "folder", folder.id)
Link to this function
file_from_path(client, path) View Source
File from path returns the file name and id for a path in Box.
{:ok, file} = Box.file_from_path(auth.client, "file.ext")
Link to this function
file_info(client, file_id) View Source
File info for a file id.
{:ok, file} = Box.file_from_path(auth.client, "file.ext")
{:ok, response} = Box.file_info(auth.client, file.id)
IO.puts(response.shared_link.download_url)
Link to this function
folder_from_path(client, path) View Source
Folder from path returns the folder id for a path in Box.
{:ok, folder} = Box.folder_from_path(auth.client, "/")
Link to this function
folder_items(client, folder, fields \\ []) View Source
Folder items returns the entries in a folder.
{:ok, folder} = Box.folder_from_path(auth.client, "/")
{:ok, entries} = Box.folder_items(auth.client, folder.id, [:id, :name])
IO.inspect(entries)
Link to this function
upload(client, path, folder_id, name) View Source
Upload a local file to a folder on Box.
{:ok, folder} = Box.folder_from_path(auth.client, "/")
{:ok, _response} = Box.upload(auth.client, "path/to/file.ext", folder.id, "file.ext")