Jump to content
We apologize for the inconvenience, but chat support is currently unavailable. Please feel free to submit an email ticket or reach out at discussion.evernote.com. Thank you for understanding. ×

Getting Tags and Notes from Linked Notebook using PHP

Recommended Posts


I am trying to get Notes and Tags from Linked notebook using PHP SDK for severnote (https://github.com/evernote/evernote-sdk-php).
All i end up with is SHARD_UNAVAILABLE error.

I have have echoed relevant data for those two LinkedNotebooks:

                                                          LinkedNotebook1                                                           LinkedNotebook2
guid                                 c8252c61-cbd9-4f94-9515-fd6fb2db614e                     fc610ad2-9d83-4474-b56a-a500b22d3434

noteStoreUrl               https://www.evernote.com/shard/s172/notestore             https://www.evernote.com/shard/s172/notestore



Here is the code i am using (just for one notebook)....



$client = new Client(array(
                'token' => $accessToken,
                'sandbox' => FALSE

$notebooks = $client->getNoteStore()->listLinkedNotebooks();

  # get the right noteStore
  $note_store_uri = $notebooks[0]->noteStoreUrl;
  $shared_note_store = $client->getSharedNoteStore($notebooks[0]);

  # authenticate to the linked notebook
  $auth_result = $shared_note_store->authenticateToSharedNotebook($shareKey, $accessToken);
   # get the share token
   $share_token = $auth_result->authenticationToken;

    # get ShatedNotebook and GUID
   $sharedNotebook = $shared_note_store->getSharedNotebookByAuth($share_token);
   $guid = $sharedNotebook->notebookGuid;

    # get ShatedNotebook's Tags
    $tags = $shared_note_store->listTagsByNotebook($accessToken,   $guid);

     # get ShatedNotebook's notes
           $gmdata = new NotesMetadataResultSpec();      
            $gmdata->includeTitle = TRUE;
            $nf = new NoteFilter();
            $nf->notebookGuid =   $guid;
            $notes = $shared_note_store -> findNotesMetadata($accessToken, $nf, 0, 250, $gmdata);

Thank you for help.

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...