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

Issues connecting #20

Open
elect86 opened this issue Jul 1, 2024 · 0 comments
Open

Issues connecting #20

elect86 opened this issue Jul 1, 2024 · 0 comments

Comments

@elect86
Copy link

elect86 commented Jul 1, 2024

Hi,

nice project!

I'm trying to connect and list the table row using

# Usage with API Token
client = NocoDBRequestsClient(
    # Your API Token retrieved from NocoDB conf
    APIToken(token),
    # Your nocodb root path
    "http://192.168.11.104:8080"
)

project = NocoDBProject(
    "noco",  # org name. noco by default
    "myproject"  # project name. Case sensitive!!
)

# Retrieve a page of rows from a table
table_rows = client.table_row_list(project, "Table")

print(table_rows)

But I keep getting

Traceback (most recent call last):
File "/home/elect/PycharmProjects/datalad_automation/venv/lib/python3.12/site-packages/nocodb/infra/requests_client.py", line 28, in _request
response.raise_for_status()
File "/home/elect/PycharmProjects/datalad_automation/venv/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: http://192.168.11.104:8080/api/v1/db/data/noco/myproject/Table

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/elect/PycharmProjects/datalad_automation/nocodb/main.py", line 25, in
table_rows = client.table_row_list(project, "Table")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/elect/PycharmProjects/datalad_automation/venv/lib/python3.12/site-packages/nocodb/infra/requests_client.py", line 49, in table_row_list
return self._request(
^^^^^^^^^^^^^^
File "/home/elect/PycharmProjects/datalad_automation/venv/lib/python3.12/site-packages/nocodb/infra/requests_client.py", line 33, in _request
raise NocoDBAPIError(
nocodb.exceptions.NocoDBAPIError: 403 Client Error: Forbidden for url: http://192.168.11.104:8080/api/v1/db/data/noco/myproject/Table

I don't really understand why do I need a project object, which are supposed to be its org and project name

Could you help me, please?

Thanks in advance

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

1 participant