Noizu.Dropbox.Api.Files (Noizu Dropbox v0.1.0)

Copy Markdown View Source

Dropbox files/* endpoints — listing, upload/download, copy/move/delete, search, revisions, locks, tags, thumbnails, and upload sessions.

Summary

Functions

POST files/copy_batch/check_v2.

POST files/copy_batch_v2.

POST files/copy_reference/get.

POST files/create_folder_batch.

POST files/create_folder_batch/check.

POST files/create_folder_v2.

POST files/delete_batch.

POST files/delete_batch/check.

POST files/delete_v2.

POST files/download — returns %{metadata: map, body: binary, headers: list}.

Download and write body to a local file path.

POST files/download_zip.

POST files/export (Paper / Google docs etc.).

POST files/get_file_lock_batch.

POST files/get_metadata.

POST files/get_preview.

POST files/get_temporary_link.

POST files/get_temporary_upload_link.

POST files/get_thumbnail.

POST files/get_thumbnail_batch.

POST files/get_thumbnail_v2.

POST files/list_folder. Use path: "" for the root folder.

Paginate list_folder until has_more is false. Returns atom-key maps.

POST files/list_folder/continue.

POST files/list_folder/get_latest_cursor.

POST files/list_folder/longpoll (notify host; no user auth).

POST files/list_revisions.

POST files/lock_file_batch.

POST files/move_batch/check_v2.

POST files/move_batch_v2.

POST files/paper/create (content upload).

POST files/permanently_delete.

POST files/restore.

POST files/save_url.

POST files/save_url/check_job_status.

POST files/search/continue_v2.

POST files/search_v2.

POST files/tags/get.

POST files/tags/remove.

POST files/unlock_file_batch.

POST files/upload (max ~150 MB). For larger files use upload sessions.

Convenience: upload arbitrary-size binary using sessions (4 MB chunks by default).

POST files/upload_session/append_v2.

POST files/upload_session/finish_batch/check.

POST files/upload_session/finish_batch_v2.

POST files/upload_session/start.

POST files/upload_session/start_batch.

Types

opts()

@type opts() :: keyword() | map()

result()

@type result() :: {:ok, term()} | {:error, Noizu.Dropbox.Error.t()}

Functions

copy(from_path, to_path, opts \\ [])

@spec copy(String.t(), String.t(), opts()) :: result()

Alias for copy_v2/3.

copy_batch_check_v2(async_job_id, opts \\ [])

@spec copy_batch_check_v2(String.t(), opts()) :: result()

POST files/copy_batch/check_v2.

copy_batch_v2(entries, opts \\ [])

@spec copy_batch_v2([map()], opts()) :: result()

POST files/copy_batch_v2.

copy_reference_get(path, opts \\ [])

@spec copy_reference_get(String.t(), opts()) :: result()

POST files/copy_reference/get.

copy_reference_save(copy_reference, path, opts \\ [])

@spec copy_reference_save(String.t(), String.t(), opts()) :: result()

POST files/copy_reference/save.

copy_v2(from_path, to_path, opts \\ [])

@spec copy_v2(String.t(), String.t(), opts()) :: result()

POST files/copy_v2.

create_folder(path, opts \\ [])

@spec create_folder(String.t(), opts()) :: result()

Alias for create_folder_v2/2.

create_folder_batch(paths, opts \\ [])

@spec create_folder_batch([String.t()], opts()) :: result()

POST files/create_folder_batch.

create_folder_batch_check(async_job_id, opts \\ [])

@spec create_folder_batch_check(String.t(), opts()) :: result()

POST files/create_folder_batch/check.

create_folder_v2(path, opts \\ [])

@spec create_folder_v2(String.t(), opts()) :: result()

POST files/create_folder_v2.

delete(path, opts \\ [])

@spec delete(String.t(), opts()) :: result()

Alias for delete_v2/2.

delete_batch(entries, opts \\ [])

@spec delete_batch([map()], opts()) :: result()

POST files/delete_batch.

delete_batch_check(async_job_id, opts \\ [])

@spec delete_batch_check(String.t(), opts()) :: result()

POST files/delete_batch/check.

delete_v2(path, opts \\ [])

@spec delete_v2(String.t(), opts()) :: result()

POST files/delete_v2.

download(path, opts \\ [])

@spec download(String.t(), opts()) :: result()

POST files/download — returns %{metadata: map, body: binary, headers: list}.

download_to_file(local_path, remote_path, opts \\ [])

@spec download_to_file(Path.t(), String.t(), opts()) :: result()

Download and write body to a local file path.

download_zip(path, opts \\ [])

@spec download_zip(String.t(), opts()) :: result()

POST files/download_zip.

export(path, opts \\ [])

@spec export(String.t(), opts()) :: result()

POST files/export (Paper / Google docs etc.).

get_file_lock_batch(entries, opts \\ [])

@spec get_file_lock_batch([map()], opts()) :: result()

POST files/get_file_lock_batch.

get_metadata(path, opts \\ [])

@spec get_metadata(String.t(), opts()) :: result()

POST files/get_metadata.

get_preview(path, opts \\ [])

@spec get_preview(String.t(), opts()) :: result()

POST files/get_preview.

get_temporary_link(path, opts \\ [])

@spec get_temporary_link(String.t(), opts()) :: result()

POST files/get_temporary_link.

get_temporary_upload_link(commit_info, opts \\ [])

@spec get_temporary_upload_link(map(), opts()) :: result()

POST files/get_temporary_upload_link.

get_thumbnail(path, opts \\ [])

@spec get_thumbnail(String.t(), opts()) :: result()

POST files/get_thumbnail.

get_thumbnail_batch(entries, opts \\ [])

@spec get_thumbnail_batch([map()], opts()) :: result()

POST files/get_thumbnail_batch.

get_thumbnail_v2(resource, opts \\ [])

@spec get_thumbnail_v2(map(), opts()) :: result()

POST files/get_thumbnail_v2.

list_folder(path, opts \\ [])

@spec list_folder(String.t(), opts()) :: result()

POST files/list_folder. Use path: "" for the root folder.

list_folder_all(path, opts \\ [])

@spec list_folder_all(String.t(), opts()) :: result()

Paginate list_folder until has_more is false. Returns atom-key maps.

list_folder_continue(cursor, opts \\ [])

@spec list_folder_continue(String.t(), opts()) :: result()

POST files/list_folder/continue.

list_folder_get_latest_cursor(path, opts \\ [])

@spec list_folder_get_latest_cursor(String.t(), opts()) :: result()

POST files/list_folder/get_latest_cursor.

list_folder_longpoll(cursor, opts \\ [])

@spec list_folder_longpoll(String.t(), opts()) :: result()

POST files/list_folder/longpoll (notify host; no user auth).

list_revisions(path, opts \\ [])

@spec list_revisions(String.t(), opts()) :: result()

POST files/list_revisions.

lock_file_batch(entries, opts \\ [])

@spec lock_file_batch([map()], opts()) :: result()

POST files/lock_file_batch.

move(from_path, to_path, opts \\ [])

@spec move(String.t(), String.t(), opts()) :: result()

Alias for move_v2/3.

move_batch_check_v2(async_job_id, opts \\ [])

@spec move_batch_check_v2(String.t(), opts()) :: result()

POST files/move_batch/check_v2.

move_batch_v2(entries, opts \\ [])

@spec move_batch_v2([map()], opts()) :: result()

POST files/move_batch_v2.

move_v2(from_path, to_path, opts \\ [])

@spec move_v2(String.t(), String.t(), opts()) :: result()

POST files/move_v2.

paper_create(path, data, import_format, opts \\ [])

@spec paper_create(String.t(), binary(), String.t() | atom(), opts()) :: result()

POST files/paper/create (content upload).

paper_update(path, data, import_format, doc_update_policy, opts \\ [])

@spec paper_update(
  String.t(),
  binary(),
  String.t() | atom(),
  String.t() | atom(),
  opts()
) :: result()

POST files/paper/update (content upload).

permanently_delete(path, opts \\ [])

@spec permanently_delete(String.t(), opts()) :: result()

POST files/permanently_delete.

restore(path, rev, opts \\ [])

@spec restore(String.t(), String.t(), opts()) :: result()

POST files/restore.

save_url(path, url, opts \\ [])

@spec save_url(String.t(), String.t(), opts()) :: result()

POST files/save_url.

save_url_check_job_status(async_job_id, opts \\ [])

@spec save_url_check_job_status(String.t(), opts()) :: result()

POST files/save_url/check_job_status.

search(query, opts \\ [])

@spec search(String.t(), opts()) :: result()

Alias for search_v2/2.

search_continue_v2(cursor, opts \\ [])

@spec search_continue_v2(String.t(), opts()) :: result()

POST files/search/continue_v2.

search_v2(query, opts \\ [])

@spec search_v2(String.t(), opts()) :: result()

POST files/search_v2.

tags_add(path, tag_text, opts \\ [])

@spec tags_add(String.t(), String.t(), opts()) :: result()

POST files/tags/add.

tags_get(paths, opts \\ [])

@spec tags_get([String.t()], opts()) :: result()

POST files/tags/get.

tags_remove(path, tag_text, opts \\ [])

@spec tags_remove(String.t(), String.t(), opts()) :: result()

POST files/tags/remove.

unlock_file_batch(entries, opts \\ [])

@spec unlock_file_batch([map()], opts()) :: result()

POST files/unlock_file_batch.

upload(path, data, opts \\ [])

@spec upload(String.t(), binary(), opts()) :: result()

POST files/upload (max ~150 MB). For larger files use upload sessions.

Options

  • :mode"add" | "overwrite" | %{".tag" => "update", "update" => rev}

  • :autorename, :mute, :strict_conflict, :client_modified, :property_groups

upload_large(path, data, opts \\ [])

@spec upload_large(String.t(), binary(), opts()) :: result()

Convenience: upload arbitrary-size binary using sessions (4 MB chunks by default).

Options

  • :chunk_size — bytes per chunk (default 4_194_304)
  • :mode — commit mode (default "overwrite")
  • :autorename — passed to commit (default false)

upload_session_append_v2(cursor, data, opts \\ [])

@spec upload_session_append_v2(map(), binary(), opts()) :: result()

POST files/upload_session/append_v2.

upload_session_finish(cursor, commit, data \\ "", opts \\ [])

@spec upload_session_finish(map(), map(), binary(), opts()) :: result()

POST files/upload_session/finish.

upload_session_finish_batch_check(async_job_id, opts \\ [])

@spec upload_session_finish_batch_check(String.t(), opts()) :: result()

POST files/upload_session/finish_batch/check.

upload_session_finish_batch_v2(entries, opts \\ [])

@spec upload_session_finish_batch_v2([map()], opts()) :: result()

POST files/upload_session/finish_batch_v2.

upload_session_start(data \\ "", opts \\ [])

@spec upload_session_start(binary(), opts()) :: result()

POST files/upload_session/start.

upload_session_start_batch(num_sessions, opts \\ [])

@spec upload_session_start_batch(pos_integer(), opts()) :: result()

POST files/upload_session/start_batch.