Notion API master series 14 - Analysis - Retrieve a page property Item

소찬 (Chan)·2022년 10월 11일
0
post-thumbnail

Reference API URL : Retrieve a page property item

Already mentioned partly from Analysis -Retrieve a page, but there's one more point.

notion.pages.properties.retrieve(page_id='1f217cc1-225f-4580-8e22-cd7eb8db3c5e',
                                 property_id='%3EQQn')

We know page_id, but what is property_id?
Let's find out properties.

'properties': {'상태': {'id': '%3EQQn',
                      'select': {'color': 'orange',
                                 'id': 'ed26ef07-df97-4ced-9275-9aa0c71d5bb1',
                                 'name': '★★'},
                      'type': 'select'},
               '이름': {'id': 'title',
                       'title': [{'annotations': {'bold': False,
                                                  'code': False,
                                                  'color': 'default',
                                                  'italic': False,
                                                  'strikethrough': False,
                                                  'underline': False},
                                  'href': None,
                                  'plain_text': '옐로우피자',
                                  'text': {'content': '옐로우피자',
                                           'link': None},
                                           'type': 'text'}],
                       'type': 'title'}}

Here we can identify two ids. First is '%3EQQn' another is 'title'. These property ids are property_id.

It is the way how to call.

notion.pages.properties.retrieve(page_id='1f217cc1-225f-4580-8e22-cd7eb8db3c5e',
                                 property_id='%3EQQn')

Call like above, and response is as below.

{'id': '%3EQQn',
 'object': 'property_item',
 'select': {'color': 'red',
            'id': '38c1a71b-fd4d-4353-858b-646d8305332a',
            'name': '★★★★★★'},
 'type': 'select'}

Show the id of related property.

  • page_size (int32)
    For paginated properties. The max number of property item objects on a page. The default size is 100
    We can set the result size at once. If we skip, API brings 100 bunches of information as the default value.

  • start_cursor (string)
    For paginated properties.
    If the return value is has_more : True, and also return value gives next_cursor value together.

 'has_more': True,
 'next_cursor': 'XYVaKx',
 'object': 'list',
 'property_item': {'id': 'qgqA',
                   'next_url': ...

Input next_cursor value into start_cursor and call retrieve. Then we can bring more results.

profile
QA Specialist

1개의 댓글

comment-user-thumbnail
2024년 11월 28일

When working with web pages, retrieving page property items is essential for organizing and managing content. For instance, during a balcony inspection, property details such as the building's age, size, and condition are crucial for evaluation. By retrieving these page property items, you can ensure accurate data management. Understanding how to access and utilize these properties helps streamline workflows and enhances the overall user experience

답글 달기