postmannotion-api

Issues in creating/retrieving Database in Notion API


Issues in creating/retrieving Database in Notion API.

I'm trying to Notion API for getting a Database ID for using into Stack AI.

The issue when I get my databases the response is totally empty same as pages, but overall the API auth work fine because I can call all users.

This is an API request for retrieve from a database: https://www.notion.so/8b98602edb594430bf5b7ded36e30078?v=1e840ea228274c6d8c84f085b527a6b3

I use the database id from this link 1e840ea228274c6d8c84f085b527a6b3 So am I doing something wrong?

POSTMAN

It always responds:

{
    "object": "error",
    "status": 404,
    "code": "object_not_found",
    "message": "Could not find database with ID: 1e840ea2-2827-4c6d-8c84-f085b527a6b3. Make sure the relevant pages and databases are shared with your integration.",
    "developer_survey": "https://notionup.typeform.com/to/bllBsoI4?utm_source=postman"
}

When I create a new database it says:

Error in a Page ID

however I think I do not have to provide a page id in this call.

enter image description here


Solution

  • You may not have shared the database with your integration:

    In order to do this you have to open the database in notion, click the ... in the top right corner, and add your integration from the Add Connections menu.

    here are some more details: https://developers.notion.com/docs/create-a-notion-integration#step-2-share-a-database-with-your-integration

    The error you get when creating a database is similar, but it is now asking you to provide a page parent to the database. Refer to the documentation for a request example: https://developers.notion.com/reference/create-a-database