Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
YuanTian1991 opened this issue May 13, 2019 · 2 comments
Open

Comments

@YuanTian1991
Copy link

Hello:

I encountered an error in findNotesMetadata(). below are two routes:

Get notebooks:

router.get('/getEvernote', (req, res) => {
    var client = new Evernote.Client({ token: globaloauthAccessToken, sandbox: true, china: false });
    var noteStore = client.getNoteStore();
    noteStore.listNotebooks().then(function (notebooks) {
        var output = {
            message: 'Success.',
            notebooks: notebooks
        }
        res.json(output);
        return;
    })
})

Above piece of code is working well, I can get data like if I directly call http://localhost:3000/api/getEvernote:

{
  "message": "Success.",
  "notebooks": [
    {
      "guid": "XXXXX",
      "name": "XXX",
      "updateSequenceNum": 28,
      "defaultNotebook": true,
      "serviceCreated": 1546454274000,
      "serviceUpdated": 1557700199000,
      "publishing": null,
...

However, below route is not working:

Get all Notes meta data:

router.get('/getNotes', (req, res) => {
    var client = new Evernote.Client({ token: globaloauthAccessToken, sandbox: true, china: false });
    var noteStore = client.getNoteStore();
    const filter = new Evernote.NoteStore.NoteFilter({
        ascending: false,
    });

    const spec = new Evernote.NoteStore.NotesMetadataResultSpec({
        includeTitle: true
    });

    noteStore.findNotesMetadata(filter, 0, 100, spec)
        .then(data => {
            var output = {
                message: 'Success.',
                data: data
            }
            res.json(output);
            return;
        })
        .catch(err => {
            console.log(err)
        });
})

In the above code, I can only receive an error like:

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

I was thinking it could be that my API key is a basic version, not full permission, so I requested a new one, with full permission, but the error is still the same. What is errorCode 3 mean?

Any help would be very much appreciated.

Best
Tian

@Daimond80
Copy link

The same error with me

@OctaconDeveloper
Copy link

had the same issues, but i had to pass the consumerKey and consumerSecret and it worked well like so
new Evernote.Client({
consumerKey: consumerKey,
consumerSecret: consumerSecret,
china: false,
token: myToken,
sandbox: true
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants