-
-
Notifications
You must be signed in to change notification settings - Fork 161
-
I am facing a strange problem here. I have no problem using notion sdk to create, query and delete pages, but when it comes to updating a page properties, it always results in a 401 Error: API token is invalid. I'm really confused whether I did something wrong with my codes, token setup, wrong formatting of the properties to be updated or it's just a bug.
The images below are my codes and the logs. Much appreciated if anyone can help me solve this problem here. Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions
I think you have two problems:
- Your update parameters are invalid (there's at least
properties={"properties": ...}}
that seems wrong at first sight) – please refer to the Notion API reference; - HTTPX seems out of date, because
httpx.HTTPStatusError
should exist since version 0.14.0 (August 7th, 2020).
What version do you use?
Replies: 1 comment 1 reply
-
I think you have two problems:
- Your update parameters are invalid (there's at least
properties={"properties": ...}}
that seems wrong at first sight) – please refer to the Notion API reference; - HTTPX seems out of date, because
httpx.HTTPStatusError
should exist since version 0.14.0 (August 7th, 2020).
What version do you use?
Beta Was this translation helpful? Give feedback.
All reactions
-
I have solved the problem, after looking into your answer. Thanks. There are a few helpful links below in case anyone facing a similar problem in the future.
For 1, I found the Page properties and Property values in the the Notion API reference.
Noted that in page properties, there is a properties={"properties": ...}} in its Example properties body param for a POST or PATCH page in the page properties page (but it is not needed in my final code) (Maybe I misunderstood something there)
image
For 2, updating the library solves my problem.
Anyway. Thank you for the help.
Beta Was this translation helpful? Give feedback.