0

Code:

private void GetDBase() throws IOException {

   try
   {
       client = new NotionClient(TOKEN);
       String t = client.getToken();
       System.out.println(t);

   }
   catch(Exception e)
   {

   }

   Users users = client.listUsers();
   List<User> uusers = users.getResults();
 for(User u : uusers)
   {
      String out = "";
      out = "USER:" + u.getName() + " " + u.getId() + "\n";
      System.out.println(out);;
  }
    Database db= client.retrieveDatabase(DATABASE_ID);  --------->error message below
    String id = db.getId();
   System.out.println(id);    
   client.close();
}

Error Message:

I get the DATABASE_ID from the URL when the database is displayed in the browser but the following error occurs:

body {"object":"error","status":404,"code":"object_not_found","message":"Could not find database with ID: 35ecc67e-eda3-4929-94f7-9d3bbf2ad297. Make sure the relevant pages and databases are shared with your integration."}

Any suggestions?

I should get a Response/Request object that I can parse in Java

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Gary
  • 1
  • 1

0 Answers0