Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue running the script #1

Closed
celineangct opened this issue Jul 22, 2021 · 4 comments
Closed

Issue running the script #1

celineangct opened this issue Jul 22, 2021 · 4 comments

Comments

@celineangct
Copy link

celineangct commented Jul 22, 2021

Hi, I am getting this error when running the script. May I know how do I resolve this?

Traceback (most recent call last):
  File "C:\Users\Celine Ang\Desktop\notionCalSync.py", line 89, in <module>
    service = get_calendar_service()
  File "C:\Users\Celine Ang\Desktop\notionCalSync.py", line 49, in get_calendar_service
    flow = InstalledAppFlow.from_client_secrets_file(
  File "D:\Softwares\Python\Python38\lib\site-packages\google_auth_oauthlib\flow.py", line 203, in from_client_secrets_file
    with open(client_secrets_file, "r") as json_file:
FileNotFoundError: [Errno 2] No such file or directory: 'credentials.json'
@yassenshopov
Copy link
Owner

Hi, I am getting this error when running the script. May I know how do I resolve this?

Traceback (most recent call last):
  File "C:\Users\Celine Ang\Desktop\notionCalSync.py", line 89, in <module>
    service = get_calendar_service()
  File "C:\Users\Celine Ang\Desktop\notionCalSync.py", line 49, in get_calendar_service
    flow = InstalledAppFlow.from_client_secrets_file(
  File "D:\Softwares\Python\Python38\lib\site-packages\google_auth_oauthlib\flow.py", line 203, in from_client_secrets_file
    with open(client_secrets_file, "r") as json_file:
FileNotFoundError: [Errno 2] No such file or directory: 'credentials.json'

The problem is in the missing "credentials.json" file. You can download this file when you register for a Google Developer account and use the Calendar API.

@celineangct
Copy link
Author

Thanks for the prompt reply

Now there seems to be something wrong with my database id... Any idea why?
I copied the 32 characters before the "?" in the URL

Traceback (most recent call last):
  File "D:\Softwares\Python\Python38\lib\site-packages\notion_client\client.py", line 83, in _parse_response
    response.raise_for_status()
  File "D:\Softwares\Python\Python38\lib\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/6f3cexxxxxxxxxxxxxxxxxxxxxxxxxxx/query
For more information check: https://httpstatuses.com/404

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Celine Ang\Desktop\notionCalSync.py", line 136, in <module>
    Notion_today = notion.databases.query(
  File "D:\Softwares\Python\Python38\lib\site-packages\notion_client\api_endpoints.py", line 46, in query
    return self.parent.request(
  File "D:\Softwares\Python\Python38\lib\site-packages\notion_client\client.py", line 133, in request
    return self._parse_response(response)
  File "D:\Softwares\Python\Python38\lib\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: 6f3cexxxxxxxxxxxxxxxxxxxxxxxxxxx.

@yassenshopov
Copy link
Owner

Are you sure you have made a Notion integration? My guess is that you haven't, thus Notion does not have access to your DB via the API. You can make an integration here, and you can give cess to your DB by going to it and using the "Share" option, then choose your integration.

@celineangct
Copy link
Author

Hi, I managed to get it to work now. It's because I did not share it with my integration. Thank you so much for your help! 😃

@yassenshopov yassenshopov pinned this issue Jul 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants