Operations on OneDrive/SharePoint files (/drives, /drive/items, etc.).
Examples
{:ok, drive} = GraphApi.Files.get_drive("user-id")
{:ok, %{"value" => items}} = GraphApi.Files.list_root_children("drive-id")
{:ok, content} = GraphApi.Files.download_content("drive-id", "item-id")
Summary
Functions
Invites recipients and adds permissions to a drive item.
Batch query variant of add_permission/4.
Copies a drive item to a new location. Returns 202 Accepted with an async monitor URL.
Batch query variant of copy_item/4.
Creates a new folder under the given parent item.
Batch query variant of create_folder/4.
Creates a sharing link for a drive item.
Batch query variant of create_sharing_link/4.
Creates an upload session for large file uploads (> 4 MB).
Batch query variant of create_upload_session/4.
Deletes a drive item.
Batch query variant of delete_item/3.
Deletes a permission from a drive item.
Batch query variant of delete_permission/4.
Downloads the content of a drive item.
Batch query variant of download_content/3.
Delta query for a drive's root folder. Returns file/folder changes since the last sync.
Batch query variant of drive_delta/2.
Gets a user's default drive.
Batch query variant of get_drive/2.
Gets a drive item by ID.
Gets a drive item by path.
Batch query variant of get_item_by_path/3.
Batch query variant of get_item/3.
Gets a shared drive item by its sharing token or encoded sharing URL.
Batch query variant of get_shared_item/2.
Gets a special folder (e.g., "documents", "photos", "approot") in a drive.
Batch query variant of get_special_folder/3.
Lists children of a specific item in a drive.
Batch query variant of list_children/3.
Lists all drives available to a user.
Batch query variant of list_drives/2.
Lists permissions on a drive item.
Batch query variant of list_permissions/3.
Lists children of the root folder in a drive.
Batch query variant of list_root_children/2.
Lists thumbnails for a drive item.
Batch query variant of list_thumbnails/3.
Lists versions of a drive item.
Batch query variant of list_versions/3.
Searches for items in a drive matching the given query string.
Batch query variant of search/3.
Updates a drive item's metadata (name, description, etc.).
Batch query variant of update_item/4.
Uploads a small file (up to 4 MB) to a drive.
Batch query variant of upload_small/4.
Functions
Invites recipients and adds permissions to a drive item.
@spec add_permission_query(String.t(), String.t(), map(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of add_permission/4.
Copies a drive item to a new location. Returns 202 Accepted with an async monitor URL.
@spec copy_item_query(String.t(), String.t(), map(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of copy_item/4.
Creates a new folder under the given parent item.
@spec create_folder_query(String.t(), String.t(), map(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of create_folder/4.
@spec create_sharing_link(String.t(), String.t(), map(), keyword()) :: {:ok, map()} | {:error, term()}
Creates a sharing link for a drive item.
@spec create_sharing_link_query(String.t(), String.t(), map(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of create_sharing_link/4.
@spec create_upload_session(String.t(), String.t(), map(), keyword()) :: {:ok, map()} | {:error, term()}
Creates an upload session for large file uploads (> 4 MB).
Returns the upload URL to use for uploading file chunks.
@spec create_upload_session_query(String.t(), String.t(), map(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of create_upload_session/4.
Deletes a drive item.
@spec delete_item_query(String.t(), String.t(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of delete_item/3.
Deletes a permission from a drive item.
@spec delete_permission_query(String.t(), String.t(), String.t(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of delete_permission/4.
Downloads the content of a drive item.
Returns {:ok, binary} with the raw file content.
@spec download_content_query(String.t(), String.t(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of download_content/3.
@spec drive_delta( String.t(), keyword() ) :: {:ok, GraphApi.Delta.delta_page()} | {:error, term()}
Delta query for a drive's root folder. Returns file/folder changes since the last sync.
@spec drive_delta_query( String.t(), keyword() ) :: GraphApi.Batch.Request.t()
Batch query variant of drive_delta/2.
Gets a user's default drive.
@spec get_drive_query( String.t(), keyword() ) :: GraphApi.Batch.Request.t()
Batch query variant of get_drive/2.
Gets a drive item by ID.
Gets a drive item by path.
The path should be relative to the root (e.g., "Documents/report.docx").
@spec get_item_by_path_query(String.t(), String.t(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of get_item_by_path/3.
@spec get_item_query(String.t(), String.t(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of get_item/3.
Gets a special folder (e.g., "documents", "photos", "approot") in a drive.
@spec get_special_folder_query(String.t(), String.t(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of get_special_folder/3.
Lists children of a specific item in a drive.
@spec list_children_query(String.t(), String.t(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of list_children/3.
Lists all drives available to a user.
@spec list_drives_query( String.t(), keyword() ) :: GraphApi.Batch.Request.t()
Batch query variant of list_drives/2.
Lists permissions on a drive item.
@spec list_permissions_query(String.t(), String.t(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of list_permissions/3.
Lists children of the root folder in a drive.
@spec list_root_children_query( String.t(), keyword() ) :: GraphApi.Batch.Request.t()
Batch query variant of list_root_children/2.
Lists thumbnails for a drive item.
@spec list_thumbnails_query(String.t(), String.t(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of list_thumbnails/3.
Lists versions of a drive item.
@spec list_versions_query(String.t(), String.t(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of list_versions/3.
Searches for items in a drive matching the given query string.
@spec search_query(String.t(), String.t(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of search/3.
Updates a drive item's metadata (name, description, etc.).
@spec update_item_query(String.t(), String.t(), map(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of update_item/4.
Uploads a small file (up to 4 MB) to a drive.
For larger files, use create_upload_session/4.
@spec upload_small_query(String.t(), String.t(), binary(), keyword()) :: GraphApi.Batch.Request.t()
Batch query variant of upload_small/4.