{"id":13994489,"url":"https://github.com/Evernote/evernote-oauth-ruby","last_synced_at":"2025-07-22T19:32:33.206Z","repository":{"id":4300098,"uuid":"5431618","full_name":"Evernote/evernote-oauth-ruby","owner":"Evernote","description":"Evernote OAuth / Thrift API client library for Ruby","archived":false,"fork":false,"pushed_at":"2023-06-02T15:00:40.000Z","size":237,"stargazers_count":74,"open_issues_count":22,"forks_count":36,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-11-29T14:51:57.682Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Evernote.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2012-08-15T21:13:06.000Z","updated_at":"2024-01-06T05:04:33.000Z","dependencies_parsed_at":"2023-01-13T16:22:57.199Z","dependency_job_id":"fcb4939c-b998-427f-a9b3-f8f37b2a13ee","html_url":"https://github.com/Evernote/evernote-oauth-ruby","commit_stats":{"total_commits":33,"total_committers":3,"mean_commits":11.0,"dds":"0.12121212121212122","last_synced_commit":"fc167d041385dd862ca6dc92f880174a11ef276d"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evernote%2Fevernote-oauth-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evernote%2Fevernote-oauth-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evernote%2Fevernote-oauth-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evernote%2Fevernote-oauth-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Evernote","download_url":"https://codeload.github.com/Evernote/evernote-oauth-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227166752,"owners_count":17740975,"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","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":[],"created_at":"2024-08-09T14:02:54.097Z","updated_at":"2024-11-29T16:31:27.327Z","avatar_url":"https://github.com/Evernote.png","language":"Ruby","readme":"[![Gem Version](https://badge.fury.io/rb/evernote_oauth.png)](http://badge.fury.io/rb/evernote_oauth)\n\nEvernote OAuth / Thrift API client library for Ruby\n===================================================\n\nInstall the gem\n---------------\ngem install evernote_oauth\n\nPrerequisites\n-------------\nIn order to use the code in this SDK, you need to obtain an API key from http://dev.evernote.com/documentation/cloud. You'll also find full API documentation on that page.\n\nIn order to run the sample code, you need a user account on the sandbox service where you will do your development. Sign up for an account at https://sandbox.evernote.com/Registration.action \n\nIn order to run the client client sample code, you need a developer token. Get one at https://sandbox.evernote.com/api/DeveloperToken.action\n\nSetup\n-----\nPut your API keys in the config/evernote.yml\n```ruby\ndevelopment:\n  consumer_key: YOUR CONSUMER KEY\n  consumer_secret: YOUR CONSUMER SECRET\n  sandbox: [true or false]\n```\nOr you can just pass those information when you create an instance of the client\n```ruby\nclient = EvernoteOAuth::Client.new(\n  consumer_key: YOUR CONSUMER KEY,\n  consumer_secret: YOUR CONSUMER SECRET,\n  sandbox: [true or false]\n)\n```\n\nUsage\n-----\n### OAuth ###\n```ruby\nclient = EvernoteOAuth::Client.new\nrequest_token = client.request_token(:oauth_callback =\u003e 'YOUR CALLBACK URL')\nrequest_token.authorize_url\n =\u003e https://sandbox.evernote.com/OAuth.action?oauth_token=OAUTH_TOKEN\n```\nTo obtain the access token\n```ruby\naccess_token = request_token.get_access_token(oauth_verifier: params[:oauth_verifier])\n```\nNow you can make other API calls\n```ruby\ntoken = access_token.token\nclient = EvernoteOAuth::Client.new(token: token)\nnote_store = client.note_store\nnotebooks = note_store.listNotebooks(token)\n```\n\n### UserStore ###\nOnce you acquire token, you can use UserStore. For example, if you want to call UserStore.getUser:\n```ruby\nuser_store = EvernoteOAuth::Client.new(token: token).user_store\nuser_store.getUser\n```\nYou can omit authenticationToken in the arguments of UserStore/NoteStore functions:\n\n### NoteStore ###\nIf you want to call NoteStore.listNotebooks:\n```ruby\nnote_store = EvernoteOAuth::Client.new(token: token).note_store\nnote_store.listNotebooks\n```\n\n### NoteStore for linked notebooks ###\nIf you want to get tags for linked notebooks:\n```ruby\nlinked_notebook = note_store.listLinkedNotebooks.first # any notebook\nshared_note_store = client.shared_note_store(linked_notebook)\nshared_notebook = shared_note_store.getSharedNotebookByAuth\nshared_note_store.listTagsByNotebook(shared_notebook.notebookGuid)\n```\n\n### NoteStore for Business ###\nIf you want to get the list of notebooks in your business account:\n```ruby\nuser_store = client.user_store\nuser = user_store.getUser\nbusiness_note_store = client.business_note_store\nif user.belongs_to_business?\n  business_note_store.listNotebooks\nend\n```\n\n### Method Chaining ###\nYou can chain methods:\n```ruby\nnote_store.findNotes(Evernote::EDAM::NoteStore::NoteFilter.new, 0, 10).first.tags.first.parent\n =\u003e [\u003cEvernote::EDAM::Type::Tag guid:\"xxxxx\", name:\"sample\", updateSequenceNum:100\u003e]\n```\nHere are the additional methods for each types:\n\n- Evernote::EDAM::NoteStore::NoteList\n  - notes\n- Evernote::EDAM::NoteStore::NoteMetadata\n  - tags\n- Evernote::EDAM::NoteStore::NotesMetadataList\n  - notes\n- Evernote::EDAM::NoteStore::SyncChunk\n  - notes, notebooks, tags, searches, resources, linkedNotebooks\n- Evernote::EDAM::Type::Note\n  - notebook, tags\n- Evernote::EDAM::Type::Resource\n  - note: needs hash argument\n      - with_constant: boolean\n      - with_resources_data: boolean\n      - with_resources_recognition: boolean\n      - with_resources_alternate_data: boolean\n- Evernote::EDAM::Type::SharedNotebook\n  - notebook\n- Evernote::EDAM::Type::Tag\n  - parent\n\nNotes: Those methods call thrift API internally.  The result will be cached in the object so that the second method call wouldn't thrift API again.\n\n### Image Adding ###\nAdditional method is defined in Note to be easily added an image:\n```ruby\nnote = Evernote::EDAM::Type::Note.new(\n  title: 'Note',\n  tagNames: ['Evernote API Sample']\n)\n\nfilename = \"enlogo.png\"\nimage = File.open(filename, \"rb\") { |io| io.read }\nhexdigest = note.add_resource(filename, image, 'image/png')\n```\nYou can use hexdigest within ENXML:\n```xml\n\u003cen-media type=\"image/png\" hash=\"#{hexdigest}\"/\u003e\n```\n\nUtility methods for Business\n----------------------------\nThis gem provides some utility methods to deal with Evernote Business.\n\n### List business notebooks ###\nTo list all business notebooks the user can access\n```ruby\nclient = EvernoteOAuth::Client.new(token: token)\nclient.list_business_notebooks\n```\n\n### Create a business note ###\nTo create a business note in a business notebook\n```ruby\nnote = Evernote::EDAM::Type::Note.new\nbusiness_notebook = client.list_business_notebooks.first\nclient.create_note_in_business_notebook(note, business_notebook)\n```\n\n### Create a business notebook ###\nTo create a business notebook\n```ruby\nnotebook = Evernote::EDAM::Type::Notebook.new\nclient.create_business_notebook(notebook)\n```\n\n### Get a notebook corresponding to the given business notebook ###\n```ruby\nbusiness_notebook = client.list_business_notebooks.first\nclient.get_corresponding_notebook(business_notebook)\n```\n\n### Determine if the user can edit the notebook ###\n```ruby\nnotebook.writable?\n```\n\n### Determine if the user is a part of a business ###\n```ruby\nuser.belongs_to_business?\n```\n\n### Get a business name of the user ###\n```ruby\nuser.business_name\n```\n\nReferences\n----------\n- Evernote Developers: http://dev.evernote.com/\n- API Document: http://dev.evernote.com/documentation/reference/\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEvernote%2Fevernote-oauth-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEvernote%2Fevernote-oauth-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEvernote%2Fevernote-oauth-ruby/lists"}