2017-01-05 99 views
0

我正在面临php云sdk中获取笔记标记的问题。我可以获取标签GUID,但无法找到真正的标签(标签名称)。印象笔记php云sdk更新笔记内容和笔记标记名称

我在更新笔记内容时也遇到问题(在现有笔记中附加新文本)。

请帮助我,在此先感谢

 $note_store=$this->evernote->getUserNotestore(); 

     $note = $note_store->getNote($accessToken, $results[0]->guid, true, false, false, false); 

     $note->content='<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"><en-note><div>'.$content.'</div><div> new Contents Here </div></en-note>'; 
; 

     //$note->content = new \Evernote\Model\PlainTextNoteContent($content."<br> New message to append."); 

     $res=$note_store->updateNote($this->profile['sSocialToken'], $note); 

     echo "<pre>",print_r($res);die(); 

回答

0

如果你有标签的GUID,您可以使用NoteStore#getTag。对于笔记内容更新,我不确定你有什么错误,所以我不完全知道问题是什么。如果您使用身份验证令牌发生EDAM错误,则表明您使用了错误的身份验证令牌。否则,你应该看到的可能是笔记内容格式。这是doc

+0

标记的另一个选项是调用getNoteTagNames(https://dev.evernote.com/doc/reference/NoteStore.html#Fn_NoteStore_getNoteTagNames)。 –

+0

@PhilSeeman我试过getNoteTagNames,但它给了我空的答复。 –

+0

'getNoteTagNames'的第二个参数是一个Note guid,而标签guid用于'getTag'。如果你只是想在特定的笔记上获得标签名称,我想'getNoteTagNames'比@PhilSeeman建议的更好。 – kentaro