Question

I do manage to get my own notes from my production account of Evernote.

However, it's impossible for me to get the notes that another account has shared with mine.

I do not know if it is because the methods are deprecated, but I do not understand it at all.

Any help, example code, or something would be very helpful!!

Thanks in advance,

ehe

EDIT:

The code I am using to get the notes someone has shared with me is the following:

def getEvernote():
    authToken= "my_auth_token"
    client = EvernoteClient(token=authToken, sandbox=False)
    userStore = client.get_user_store()
    user = userStore.getUser()
    noteStore = client.get_note_store()
    linked_notebooks = noteStore.listLinkedNotebooks(authToken)

    shared_note_store = client.get_shared_note_store(linked_notebooks[0])

    //Here, I manage to get the shared note store and the first shared notebook

    updated_filter = NoteFilter(words=' ')
    offset = 0
    max_notes = 40000
    result_spec = NotesMetadataResultSpec(includeTitle=True)

    //What is shareKey???????
    auth_result = shared_note_store.authenticateToSharedNotebook(shareKey, authToken)

    //EDAM error
    result_list = shared_note_store.findNotesMetadata(auth_result, updated_filter, offset, max_notes, result_spec)

any help??

Thanks in advance

ehe

Was it helpful?

Solution

Take a look here : http://dev.evernote.com/doc/articles/note-sharing.php (Check the "Listing All Shared Notes in an Account" part).

Do you have some code you could show ?


Here is some code that should do the trick :

import evernote.edam.notestore.NoteStore as NoteStore

from evernote.api.client import EvernoteClient
from evernote.api.client import Store
from evernote.edam.notestore.ttypes import NoteFilter, NotesMetadataResultSpec

auth_token = "YOUR TOKEN"

client = EvernoteClient(token=auth_token, sandbox=True)

noteStore = client.get_note_store()

# get linked notebooks
linked_notebooks = noteStore.listLinkedNotebooks(auth_token)

linked_notebook = linked_notebooks[0]

# shareKey for the first notebook
shareKey = linked_notebook.shareKey

# get the right noteStore
note_store_uri = linked_notebook.noteStoreUrl
shared_note_store = Store(auth_token, NoteStore.Client, note_store_uri)


# authenticate to the linked notebook
auth_result = shared_note_store.authenticateToSharedNotebook(shareKey,auth_token)

# get the share token
share_token = auth_result.authenticationToken


updated_filter = NoteFilter(words=' ')
offset = 0
max_notes = 40000
result_spec = NotesMetadataResultSpec(includeTitle=True)

result_list = shared_note_store.findNotesMetadata(share_token, updated_filter, offset,             max_notes, result_spec)

print result_list
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top