Search code examples
node.jsevernote

Evernote API developer token not authenticating


I created a developer token for evernote thought the following URL as per tutorial instructions: https://sandbox.evernote.com/api/DeveloperToken.action

I am using the following nodejs code snippet to connect to the evernote api and create a note:

const client = new evernote.Client({
    token: evernoteToken,
    sandbox: evernote.SANDBOX,
});

const noteStore = client.getNoteStore();
const note = new evernote.Types.Note();
note.notebookGuid = notebookGuid;
note.title = title;
note.content = (
    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
    +"<!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml2.dtd\">"
    +`<en-note>${body}</en-note>`
);
noteStore.createNote(note).then(function(notebook) {
    console.log(notebook);
    resolve();
}, function(err) {
    error(err);
});

Where evernoteToken is the developer token I've generated.

This produces the error log:

ThriftException { errorCode: 3, parameter: 'authenticationToken' }

I have tried generating developer tokens while logged into two different accounts, with no luck.

Any help would be appreciated.


Solution

  • I figured it out. My notebook guid was incorrect.