Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/319.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Evernote Python API中获取共享笔记?_Python_Api_Evernote - Fatal编程技术网

如何在Evernote Python API中获取共享笔记?

如何在Evernote Python API中获取共享笔记?,python,api,evernote,Python,Api,Evernote,我确实设法从Evernote的制作帐户中获得了自己的笔记 然而,我不可能得到另一个帐户与我共享的笔记 我不知道这是否是因为这些方法已被弃用,但我一点也不理解 任何帮助、示例代码或其他东西都会非常有用 提前感谢, 爱荷 编辑: 我用来获取某人与我共享的笔记的代码如下: def getEvernote(): authToken= "my_auth_token" client = EvernoteClient(token=authToken, sandbox=False) us

我确实设法从Evernote的制作帐户中获得了自己的笔记

然而,我不可能得到另一个帐户与我共享的笔记

我不知道这是否是因为这些方法已被弃用,但我一点也不理解

任何帮助、示例代码或其他东西都会非常有用

提前感谢,

爱荷

编辑:

我用来获取某人与我共享的笔记的代码如下:

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)
有什么帮助吗

提前谢谢

ehe

看看这里: (请勾选“列出帐户中的所有共享笔记”部分)

你有一些代码可以显示吗


下面是一些可以实现此目的的代码:

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

谢谢你的回答,劳伦特。但此链接说明了如何获取您与其他人共享的笔记。我要找的重点是得到其他人与我的帐户共享的笔记。看看我将开始一个新的答案,尝试更好地解释我自己。我想我理解你想要做什么。我只是没有花时间写一个明确的答案。对不起。我今天会尽量做出更好的回答。它很有效!!非常感谢你,劳伦特!!因为我的名声不能投票!