Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. router.get('/getEvernote', (req, res) => {
  2. var client = new Evernote.Client({ token: globaloauthAccessToken, sandbox: true, china: false });
  3. var noteStore = client.getNoteStore();
  4. noteStore.listNotebooks().then(function (notebooks) {
  5. var output = {
  6. message: 'Success.',
  7. notebooks: notebooks
  8. }
  9. res.json(output);
  10. return;
  11. })
  12. })
  13.  
  14. {
  15. "message": "Success.",
  16. "notebooks": [
  17. {
  18. "guid": "XXXXX",
  19. "name": "XXX",
  20. "updateSequenceNum": 28,
  21. "defaultNotebook": true,
  22. "serviceCreated": 1546454274000,
  23. "serviceUpdated": 1557700199000,
  24. "publishing": null,
  25. ...
  26.  
  27. router.get('/getNotes', (req, res) => {
  28. var client = new Evernote.Client({ token: globaloauthAccessToken, sandbox: true, china: false });
  29. var noteStore = client.getNoteStore();
  30. const filter = new Evernote.NoteStore.NoteFilter({
  31. ascending: false,
  32. });
  33.  
  34. const spec = new Evernote.NoteStore.NotesMetadataResultSpec({
  35. includeTitle: true
  36. });
  37.  
  38. noteStore.findNotesMetadata(filter, 0, 100, spec)
  39. .then(data => {
  40. var output = {
  41. message: 'Success.',
  42. data: data
  43. }
  44. res.json(output);
  45. return;
  46. })
  47. .catch(err => {
  48. console.log(err)
  49. });
  50. })
  51.  
  52. ThriftException { errorCode: 3, parameter: 'authenticationToken' }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement