Created
May 2, 2014 11:40
-
-
Save Laurent-Sarrazin/0a9bb288d780d43ade93 to your computer and use it in GitHub Desktop.
Evernote API : create notes in a linked notebook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$authToken = "YOUR DEV TOKEN"; | |
$client = new Client(array('token' => $authToken)); | |
$noteStore = $client->getNoteStore(); | |
# get linked notebooks | |
$linked_notebooks = $noteStore->listLinkedNotebooks($authToken); | |
$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 = $client->getSharedNoteStore($linked_notebook); | |
# authenticate to the linked notebook | |
$auth_result = $shared_note_store->authenticateToSharedNotebook($shareKey, $authToken); | |
# get the share token | |
$share_token = $auth_result->authenticationToken; | |
# get the shared notebook | |
$sharedNotebook = $shared_note_store->getSharedNotebookByAuth($share_token); | |
$guid = $sharedNotebook->notebookGuid; | |
$note = new Note(); | |
$note->notebookGuid = $guid; | |
$note->title = 'It Works'; | |
$shared_note_store->createNote($share_token, $note); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment