M
M
mykhailohoy2020-05-19 15:53:52
API
mykhailohoy, 2020-05-19 15:53:52

How to work with Evernote API developer token?

I wanted to try working with the Evernote API. As stated in the documentation , I created a developer token, I copied the code from the documentation:

const Evernote = require("evernote");

var developerToken = "S=here-is-my-dev-token1234";
 
var client = new Evernote.Client({token: developerToken});

// Set up the NoteStore client 
var noteStore = client.getNoteStore();
 
// Make API calls
noteStore.listNotebooks(function(notebooks) {
  for (var i in notebooks) {
    console.log("Notebook: " + notebooks[i].name);
  }
});

Everything crashes with this error:
Access to fetch at 'https://sandbox.evernote.com//edam/user' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
POST https://sandbox.evernote.com//edam/user net::ERR_FAILED

I can't figure out what it could be.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question