akarri2001 / Notion-and-Google-Calendar-2-Way-Sync

2 Way Sync Between Notion Database and Google Calendar
GNU General Public License v3.0
352 stars 50 forks source link

Cannot run the file #10

Closed lelouvincx closed 1 year ago

lelouvincx commented 3 years ago

I did exactly what the tutorial says but when I run "python3 Notion-GCal-2WaySync-Public.py" it says the following. What should I do now?


  File "/home/lelouvincx/.local/lib/python3.9/site-packages/notion_client/client.py", line 83, in _parse_response
    response.raise_for_status()
  File "/home/lelouvincx/.local/lib/python3.9/site-packages/httpx/_models.py", line 1105, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: 404 Client Error: Not Found for url: https://api.notion.com/v1/databases/3b58b006436c477e85c500fb2a41152f/query
For more information check: https://httpstatuses.com/404

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/lelouvincx/Documents/NotionXGCalendar/Notion-GCal-2WaySync-Public.py", line 394, in <module>
    my_page = notion.databases.query(  #this query will return a dictionary that we will parse for information that we want
  File "/home/lelouvincx/.local/lib/python3.9/site-packages/notion_client/api_endpoints.py", line 46, in query
    return self.parent.request(
  File "/home/lelouvincx/.local/lib/python3.9/site-packages/notion_client/client.py", line 133, in request
    return self._parse_response(response)
  File "/home/lelouvincx/.local/lib/python3.9/site-packages/notion_client/client.py", line 93, in _parse_response
    raise APIResponseError(error.response, body)
notion_client.errors.APIResponseError: Could not find database with ID: 3b58b006-436c-477e-85c5-00fb2a41152f.```
adhitht commented 2 years ago

I too have encountered the same issue. Tried

  1. Updating notion-client to 0.7
  2. Checking with another database
  3. Creating new integration
adhitht commented 2 years ago

Okay got it! This error comes when you have not shared your integration with the database in notion. Even if your database id, Notion Integration token is correct, you need to link both of them together. For that

  1. Head over to Notion and open up the database which you want to integrate with GCal image Click on that share button on the top right side
  2. image Click Add People

  3. image Click the integration it will get access to the database

  4. image

    Click Invite. Now you are good to go.