Packages
google_api_drive
0.0.1
0.32.0
0.31.1
0.31.0
0.30.1
0.30.0
0.29.3
0.29.2
0.29.1
0.29.0
0.28.0
0.27.1
0.27.0
0.26.0
0.25.1
0.25.0
0.24.0
0.23.4
0.23.3
0.23.2
0.23.1
0.23.0
0.22.1
0.22.0
0.21.1
0.21.0
0.20.4
0.20.3
0.20.2
0.20.1
0.20.0
0.19.1
0.19.0
0.18.0
0.17.0
0.16.0
0.15.0
0.14.2
0.14.1
0.14.0
0.13.1
0.13.0
0.12.0
0.11.0
0.10.0
0.9.0
0.8.0
0.7.0
0.6.0
0.5.0
0.4.0
0.3.0
0.2.2
0.2.1
0.1.0
0.0.1
Google Drive API client library. The Google Drive API allows clients to access resources from Google Drive.
Current section
Files
Jump to
Current section
Files
google_api_drive
README.md
README.md
# GoogleApi.Drive.V3
Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `google_api_drive` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:google_api_drive, "~> 0.0.1"}]
end
```
## Authentication
This API requires OAuth 2.0 to authorize requests. All requests to the Drive API
must be authorized by an authenticated user.
The details of the authorization process, or "flow," for OAuth 2.0 vary somewhat
depending on what kind of application you're writing.
See [Drive instructions](https://developers.google.com/drive/v3/web/about-auth).
## Usage
### Listing files
```elixir
conn = GoogleApi.Drive.V3.Connection.new("YOUR-API-TOKEN-HERE")
{:ok, file_list} = GoogleApi.Drive.V3.Api.Files.drive_files_list(conn)
Enum.each(file_list.files, &IO.inspect/1)
```
### Uploading a file
```elixir
conn = GoogleApi.Drive.V3.Connection.new("YOUR-API-TOKEN-HERE")
{:ok, file} =
Files.drive_files_create_simple(
conn,
"multipart",
%File{
name: "file.txt"
},
"path/to/file.txt"
)
```
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/google_api_drive](https://hexdocs.pm/google_api_drive).