I have a page https://www.notion.so/Wiki-Page-For-a-Business-Case-8ec70cd1894711a862acc61a47fdb74d
.
I would like to access this page through Python an extract its blocks. I have added successfully the Connection, received the API Key but i cannot access a site by its url or anything else through the Notion API.
Has someone an idea how this could be achieved or i have just overseen a API for this purpose.
I have tried also to use the search api:
url = "https://api.notion.com/v1/search"
token = 'secret_S5PPXrnCcJ3mA1234gYSGHzvt123dYQE2j4112bePAMD'
search_params = {"filter": {"value": "page", "property": "object", "content": "Wiki Page for a Business Case"}}
headers = {
"Authorization": "Bearer " + token,
"accept": "application/json",
"Notion-Version": "2022-06-28",
"content-type": "application/json"
}
response = requests.post(url, json=search_params, headers=headers)
print(response.text)
but this gives me
{"object":"error","status":400,"code":"validation_error","message":"body failed validation: body.filter.content should be not present, instead was `\"Wiki Page for a Business Case\"`."}