0

I read Notion-API documentation hundred times and I still can't understand how to query database by page_id or at least I think it should be a page_id. I have two databases, let's say that db1 is events and db2 is persons. Events database has a relation to Persons database and when I do a query I am getting this array of relationship ids:

"Team Member": {
        "id": "AAdX",
        "type": "relation",
        "relation": [
                {
                        "id": "8dc807b1-4584-4063-8ccd-142c75277c66"
                },
                {
                        "id": "33e321e0-8d11-4439-8dc7-887329bc2b96"
                }
        ],
        "has_more": false
}

Now when I try to make a second API call to retrieve details about Persons I don't know how to shape the query.

I tried making a POST request to https://api.notion.com/v1/databases/:id/query with following HTTP body:

{
    "filter": {
        "property": "people",
        "people": {
            "contains": "8dc807b1-4584-4063-8ccd-142c75277c66"
        }

    }
}

But I am getting following error:

{
    "object": "error",
    "status": 400,
    "code": "validation_error",
    "message": "Could not find property with name or id: people"
}

Does anybody have some advice how to overcome this? I find their API documentation horrible because they are missing examples that would solve my confusion.

Josip B.
  • 2,434
  • 1
  • 25
  • 30

0 Answers0