2017-01-05 103 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