You may be using an outdated version of the Notion Postman workspace, since on June 28th, 2022 there was a new version of the Notion API released, which now requires you to get individual properties via the /v1/pages/{page_id}/properties/{property_id}
endpoint
In your case, you will need to iterate through all of the records in your databases and all of the properties in each record:
const videos = await Promise.all(
results.map(
async (page) => {
const properties = {};
for (const propertyName of Object.keys(page.properties)) {
const propertyData = await notion.pages.properties.retrieve({
page_id: page.id,
property_id: page.properties[propertyName].id,
});
properties[propertyName] = propertyData;
}
return properties;
}
)
)
Here's an excerpt from the announcement:
Today we’re releasing Notion-Version 2022-06-28
with the following backwards incompatible changes:
- Page properties must be retrieved using the page properties endpoint.
- ...
Previously, the page object returned from page endpoints, as well as the query database and search endpoint, returned a properties field that contained all the page’s properties along with its value.
While convenient, returning accurate results for all properties resulted in bad performance and timeouts for larger databases or pages with lots of mentions. To combat performance, on March 1st, we added a disclaimer that page objects stopped returning accurate results for pages with more than 25 mentions to other objects (which affected properties of type title, rich_text, relation, people, rollup, and formula).
In October 2021, we introduced a way to more accurately retrieve individual page properties via the retrieve a page property item endpoint. With this endpoint, we’re able to paginate complex properties that involve additional look-ups.
With version 2022-06-28, the type and property value from page objects are removed. Thus moving forward, all property value retrieval must happen through the retrieve a page property item endpoint.