首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Evernote php -从链接的笔记本中获取笔记

Evernote php -从链接的笔记本中获取笔记
EN

Stack Overflow用户
提问于 2017-07-13 05:07:56
回答 1查看 160关注 0票数 0

我正在使用这个SDK - https://github.com/evernote/evernote-cloud-sdk-php

我可以在我自己的笔记本中找到笔记,如下所示:

代码语言:javascript
复制
$client = new \Evernote\Client($token, false);

$search = new \Evernote\Model\Search('*');

$notebook = $client->getNotebook('notebook_id');

$scope = \Evernote\Client::SEARCH_SCOPE_ALL;

$order = \Evernote\Client::SORT_ORDER_REVERSE | \Evernote\Client::SORT_ORDER_RECENTLY_CREATED;

$results = $client->findNotesWithSearch($search, $notebook, $scope, $order, 20);

它可以工作,但如果我尝试从链接的笔记本中获取笔记,它总是得到空的结果。

尝试实现这一点- https://dev.evernote.com/doc/articles/sharing.php

代码语言:javascript
复制
$adClient = new \Evernote\AdvancedClient($token ,false);

$store = $adClient->getSharedNoteStore('linked_notbook_id');

$client = new \Evernote\Client($store->getToken(), false);

$search = new \Evernote\Model\Search('*');

$notebook = $carrier->getLinkedNotebooks()[0];

$scope = \Evernote\Client::SEARCH_SCOPE_ALL;

$order = \Evernote\Client::SORT_ORDER_REVERSE | \Evernote\Client::SORT_ORDER_RECENTLY_CREATED;

$results = $client->findNotesWithSearch($search, $notebook, $scope, $order, 20);

同样的,空的结果。

EN

回答 1

Stack Overflow用户

发布于 2017-07-14 04:13:35

这个$carrier是从哪里来的?

代码语言:javascript
复制
$notebook = $carrier->getLinkedNotebooks()[0];

假设它是$client,则将SharedNoteStore中的LinkedNotebook赋值给$notebook,并将其传递给findNotesWithSearch,这似乎并不正确。

  1. LinkedNotebook对象用于与共享笔记本的用户。因此,使用SharedNoteStore调用该API可能不是您想要的。请参见findNotesWithSearch的第二个参数的https://dev.evernote.com/doc/articles/sharing.php
  2. The类型为Notebook。可以在SharedNotebook.

中找到notebookGuid

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45067540

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档