http://gihyo.jp/dev/serial/01/evernote_api
1.     • UserStore:     • OAuth: OAuth2.     • NoteStore
UserStoreString userStoreUrl = "https://sandbox.evernote.com/edam/user";THttpClient userStoreTransport = new THttpClient(u...
https://sandbox.evernote.com
JavaString userStoreUrl = "https://sandbox.evernote.com/edam/user";THttpClient userStoreTransport = new THttpClient(userSt...
NoteStoreUser user = authResult.getUser();String shardId = user.getShardId();String noteStoreUrl = "https://sandbox.everno...
List notebooks = noteStore.listNotebooks(authToken);for (Notebook notebook : notebooks) {  System.out.println("Notebook: "...
Note note = new Note();note.setTitle("           ");String content = "<?xml version="1.0" encoding="UTF-8"?>" +  "<!DOCTYP...
Resource resource = new Resource();resource.setData(data);resource.setMime("image/jpeg");Note note = new Note();note.setTi...
Android
http://discussion.evernote.com
http://discussion.evernote.com/forum/61-evernote-for-developers/
Evernote ウェブサービスAPI
Evernote ウェブサービスAPI
Evernote ウェブサービスAPI
Evernote ウェブサービスAPI
Evernote ウェブサービスAPI
Evernote ウェブサービスAPI
Evernote ウェブサービスAPI
Evernote ウェブサービスAPI
Evernote ウェブサービスAPI
Upcoming SlideShare
Loading in …5
×

Evernote ウェブサービスAPI

1,560 views

Published on

Evernote Developer Meetup, 2011/11/10

Published in: Technology, News & Politics
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,560
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
5
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Evernote ウェブサービスAPI

  1. 1. http://gihyo.jp/dev/serial/01/evernote_api
  2. 2. 1. • UserStore: • OAuth: OAuth2. • NoteStore
  3. 3. UserStoreString userStoreUrl = "https://sandbox.evernote.com/edam/user";THttpClient userStoreTransport = new THttpClient(userStoreUrl);TBinaryProtocol userStoreProtocol = new TBinaryProtocol(userStoreTransport);UserStore.Client userStore = new UserStore.Client(userStoreProtocol);......AuthenticationResult authResult = null;try { authResult = userStore.authenticate(username, password, consumerKey, consumerSecret);} catch (EDAMUserException ex) { String parameter = ex.getParameter(); EDAMErrorCode errorCode = ex.getErrorCode();......}String authToken = authResult.getAuthenticationToken();
  4. 4. https://sandbox.evernote.com
  5. 5. JavaString userStoreUrl = "https://sandbox.evernote.com/edam/user";THttpClient userStoreTransport = new THttpClient(userStoreUrl);TBinaryProtocol userStoreProtocol = new TBinaryProtocol(userStoreTransport);UserStore.Client userStore = new UserStore.Client(userStoreProtocol);RubyuserStoreUrl = "https://sandbox.evernote.com/edam/user"userStoreTransport = Thrift::HTTPClientTransport.new(userStoreUrl)userStoreProtocol = Thrift::BinaryProtocol.new(userStoreTransport)userStore = Evernote::EDAM::UserStore::UserStore::Client.new(userStoreProtocol)
  6. 6. NoteStoreUser user = authResult.getUser();String shardId = user.getShardId();String noteStoreUrl = "https://sandbox.evernote.com/edam/note/" + shardId;THttpClient noteStoreTransport = new THttpClient(noteStoreUrl);TBinaryProtocol noteStoreProtocol = new TBinaryProtocol(noteStoreTransport);noteStore = new NoteStore.Client(noteStoreProtocol);
  7. 7. List notebooks = noteStore.listNotebooks(authToken);for (Notebook notebook : notebooks) { System.out.println("Notebook: " + notebook.getName());}
  8. 8. Note note = new Note();note.setTitle(" ");String content = "<?xml version="1.0" encoding="UTF-8"?>" + "<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">" + "<en-note> </en-note>";note.setContent(content);Note createdNote = noteStore.createNote(authToken, note);System.out.println("GUID: " + createdNote.getGuid());
  9. 9. Resource resource = new Resource();resource.setData(data);resource.setMime("image/jpeg");Note note = new Note();note.setTitle(" ");note.addToResources(resource);String content = "<?xml version="1.0" encoding="UTF-8"?>" + "<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">" + "<en-note><p> </p>" + "<en-media type="image/jpeg" hash="" + EDAMUtil.bytesToHex(resource.getData().getBodyHash()) + ""/>" + "</en-note>";note.setContent(content);Note createdNote = noteStore.createNote(authToken, note);
  10. 10. Android
  11. 11. http://discussion.evernote.com
  12. 12. http://discussion.evernote.com/forum/61-evernote-for-developers/

×