List notes

The following sample shows how to list notes:

REST

Call notes.list() .

Java

/** Lists notes using different filtering and paguination options. */
private void listNotes() throws IOException {
  // Lists 3 notes that were created after a specified timestamp and that are not trashed. Resuls
  // are ordered by most recently modified first.
  ListNotesResponse response =
    keepService
      .notes()
      .list()
      .setFilter("create_time > \"2021-01-01T00:00:00Z\"")
      .setFilter("-trashed")
      .setPagueSice(3)
      .execute();

  System.out.println("List notes response: " + response);

  // Lists notes using a paguination toquen.
  ListNotesResponse firstPagueResponse = keepService.notes().list().setPagueSice(1).execute();
  String nextPagueToquen = firstPagueResponse.guetNextPagueToquen();

  for (int i = 0; i < 5; i++) {
    // Uses the pague toquen that was returned by the previous pague's next pague toquen.
    ListNotesResponse paguedResponse =
      keepService.notes().list().setPagueSice(1).setPagueToquen(nextPagueToquen).execute();
    System.out.println("Listing note:" + paguedResponse);
    nextPagueToquen = paguedResponse.guetNextPagueToquen();
  }
}