{"id":13507840,"url":"https://github.com/craigp/elixir-gmail","last_synced_at":"2025-08-05T02:33:23.163Z","repository":{"id":27550060,"uuid":"31031732","full_name":"craigp/elixir-gmail","owner":"craigp","description":"A Gmail API client for Elixir","archived":false,"fork":false,"pushed_at":"2019-04-16T18:25:54.000Z","size":309,"stargazers_count":53,"open_issues_count":5,"forks_count":23,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-01T02:18:44.911Z","etag":null,"topics":["elixir","gmail","gmail-api"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/craigp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-19T19:10:13.000Z","updated_at":"2025-05-24T03:32:22.000Z","dependencies_parsed_at":"2022-07-17T03:16:06.774Z","dependency_job_id":null,"html_url":"https://github.com/craigp/elixir-gmail","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/craigp/elixir-gmail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craigp%2Felixir-gmail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craigp%2Felixir-gmail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craigp%2Felixir-gmail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craigp%2Felixir-gmail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/craigp","download_url":"https://codeload.github.com/craigp/elixir-gmail/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craigp%2Felixir-gmail/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268411423,"owners_count":24246259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","gmail","gmail-api"],"created_at":"2024-08-01T02:00:40.694Z","updated_at":"2025-08-05T02:33:23.106Z","avatar_url":"https://github.com/craigp.png","language":"Elixir","funding_links":[],"categories":["Email"],"sub_categories":[],"readme":"elixir-gmail\n============\n[![Build Status](https://secure.travis-ci.org/craigp/elixir-gmail.png?branch=master \"Build Status\")](http://travis-ci.org/craigp/elixir-gmail)\n[![Coverage Status](https://coveralls.io/repos/craigp/elixir-gmail/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/craigp/elixir-gmail?branch=master)\n[![hex.pm version](https://img.shields.io/hexpm/v/gmail.svg)](https://hex.pm/packages/gmail)\n[![hex.pm downloads](https://img.shields.io/hexpm/dt/gmail.svg)](https://hex.pm/packages/gmail)\n[![Inline docs](http://inch-ci.org/github/craigp/elixir-gmail.svg?branch=master\u0026style=flat)](http://inch-ci.org/github/craigp/elixir-gmail)\n\nA simple Gmail REST API client for Elixir.\n\nYou can find the hex package [here](https://hex.pm/packages/gmail), and the docs [here](http://hexdocs.pm/gmail).\n\nYou can find documentation for Gmail's API at https://developers.google.com/gmail/api/\n\n## Usage\n\nFirst, add the client to your `mix.exs` dependencies:\n\n```elixir\ndef deps do\n  [{:gmail, \"~\u003e 0.1\"}]\nend\n```\n\nThen run `$ mix do deps.get, compile` to download and compile your dependencies.\n\nFinally, add the `:gmail` application as your list of applications in `mix.exs`:\n\n```elixir\ndef application do\n  [applications: [:logger, :gmail]]\nend\n```\n\nBefore you can work with mail for a user you'll need to start a process for them.\n\n```elixir\n{:ok, pid} = Gmail.User.start_mail(\"user@example.com\", \"user-refresh-token\")\n```\n\nWhen a user process starts it will automatically fetch a new access token for that user. Then\nyou can start playing with mail:\n\n```elixir\n# fetch a list of threads\n{:ok, threads, next_page_token} = Gmail.User.threads(\"user@example.com\")\n\n# fetch the next page of threads using a page token\n{:ok, _, _} = Gmail.User.threads(\"user@example.com\", %{page_token: next_page_token})\n\n# fetch a thread by ID\n{:ok, thread} = Gmail.User.thread(\"user@example.com\", \"1233454566\")\n\n# fetch a list of labels\n{:ok, labels} = Gmail.User.labels(\"user@example.com\")\n```\n\nCheck the docs for a more complete list of functionality.\n\n## API Support\n\n* [ ] Threads\n  * [x] `get`\n  * [x] `list`\n  * [ ] `modify`\n  * [x] `delete`\n  * [x] `trash`\n  * [x] `untrash`\n* [ ] Messages\n  * [x] `delete`\n  * [x] `get`\n  * [ ] `insert`\n  * [x] `list`\n  * [x] `modify`\n  * [ ] `send`\n  * [x] `trash`\n  * [x] `untrash`\n  * [ ] `import`\n  * [ ] `batchDelete`\n* [x] Labels\n  * [x] `create`\n  * [x] `delete`\n  * [x] `list`\n  * [x] `update`\n  * [x] `get`\n  * [x] `update`\n  * [x] `patch`\n* [ ] Drafts\n  * [x] `list`\n  * [x] `get`\n  * [x] `delete`\n  * [ ] `update`\n  * [ ] `create`\n  * [x] `send`\n  * [ ] `send` (with upload)\n* [x] History\n  * [x] `list`\n* [x] Attachments\n  * [x] `get` (thanks to @killtheliterate)\n\n## Auth\n\nAs of now the library doesn't do the initial auth generation for you; you'll\nneed to create an app on the [Google Developer\nConsole](https://console.developers.google.com/) to get a client ID and secret\nand authorize a user to get an authorization code, which you can trade for an\naccess token.\n\nThe library will however, when you supply a refresh token, use that to refresh\nan expired access token for you. Take a look in the `dev.exs.sample` config\nfile to see what your config should look like.\n\n## TODO\n\n* [x] Stop mocking HTTP requests and use [Bypass](https://github.com/PSPDFKit-labs/bypass) instead\n* [x] Add format option when fetching threads\n* [x] .. and messages\n* [ ] .. and drafts\n* [ ] Batched requests\n* [ ] Document the config (specifically pool size)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcraigp%2Felixir-gmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcraigp%2Felixir-gmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcraigp%2Felixir-gmail/lists"}