Can't Connect to Notion API

Viewed 1460

I'm Uğur,

https://developers.notion.com/reference/retrieve-a-database

https://api.notion.com/v1/databases/database_id

I used "https://www.notion.so/111111111111111111?v=222222222222222" as a database ID. (http://prntscr.com/22cn4dp)

I used "Authorization: Bearer $NOTION_API_KEY and Notion-Version: 2021-08-16" as a cURL.

I used it with Postman but I got an error.

Error Code:

{
    "object": "error",
    "status": 404,
    "code": "object_not_found",
    "message": "Could not find database with ID: 1111111111111111."
}

How do I solve it?

3 Answers

I had the same issue for a few days now. The problem I had was quite simple and turns out that I just never had the workspace shared with my integration.I [checked this video][1] at around 3 mins and only then realised that you need to share your pages and databases with the integration

Your Notion-Version looks correct but your database id should be the content after your Notion page url i.e. https://www.notion.so/DatabaseiD. Also if you're using Postman your Authorization should be set to type 'Bearer Token' with the Notion API Key that you obtained from your integration found here.

I had some trouble getting notion to work with Zotero using the Notero plugin. I created the integration and created the database but I did not explicitly share the database with the integration. After sharing the database with the integration, Notero works perfectly.

To share the database with the integration after creating the database and integration

  1. Go to the Notion page containing the database
  2. Click the share button in the upper right corner of the Notion window
  3. In the text box type in the name of your integration (In the picture below my integration was called "papers")
  4. Select your Integration (the window should now resemble the picture below)
  5. Alter a citation in Zotero to confirm that your integration works.

Example of using the share button for adding an integration

Related