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

incorrect API error message #371

Closed
C11235 opened this issue Sep 18, 2023 · 5 comments
Closed

incorrect API error message #371

C11235 opened this issue Sep 18, 2023 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@C11235
Copy link

C11235 commented Sep 18, 2023

Hi,
I tried to use the REST API as suggested in the documentation with the CURL command and the URL corresponding to the REST API string provided in the nextcloud analytics web interface after adding a local dataset.

curl -u user:password -d '{"data":[{"dimension1": "x", "dimension2": "x", "value": "1"}]}' -X POST -H "Content-Type: application/json" https://***/apps/analytics/api/3.0/data/1/add

However, this results in the error {"success":false,"error":{"code":9002,"message":"Report does not allow data maintenance"}}, which I am not able to fix using existing user documentation. My goal was to create a local database on the nextcloud instance that is updated via the REST API. This might either be a bug or me misinterpreting the user documentation. Please help me.
Thank you!

@Rello
Copy link
Owner

Rello commented Sep 20, 2023

Hi,
thank you for the issue report. I will check

@Rello Rello self-assigned this Sep 20, 2023
@Rello Rello added the in progress development in progress label Sep 20, 2023
@Rello
Copy link
Owner

Rello commented Sep 24, 2023

Hello,
I just checked and everything is working. Please consider that you can only add data to internal datasets. So you need to use the id of the dataset - not the report.
You can get the ID from the URL of the dataset maintenance or in the report if you go to "Data"->"REST API" in the sidebar.

please let me know if this is working...

@Rello Rello added needs info feedback from requester required and removed in progress development in progress labels Sep 24, 2023
@C11235
Copy link
Author

C11235 commented Sep 24, 2023

Thank you!

I'm sorry, I checked again, it is indeed working.

However, I think there is a bug concerning the returned error message. My mistake was, that I had two users A and B with two different internal data sets, I accidentally tried to access the dataset of user A with the credentials of user B. I didn't spot it at first due to this error message posted earlier. It might be more convenient if in this scenario instead an error message such as "This dataset does not exist for this user" is returned.

@Rello
Copy link
Owner

Rello commented Sep 25, 2023

Hello,
I found an issue with the API to show incorrect messages in some constellations.
it will now return a
"error":{"code":9003,"message":"Unknown or unauthorized report or dataset"}

@Rello Rello changed the title Add using REST API 3.0 returns "Report does not allow data maintenance" incorrect API error message Sep 25, 2023
@Rello Rello added this to the 4.11.0 milestone Sep 25, 2023
@Rello Rello added bug Something isn't working pending release part of the next release version and removed needs info feedback from requester required labels Sep 25, 2023
Rello added a commit that referenced this issue Sep 25, 2023
Rello added a commit that referenced this issue Sep 25, 2023
@C11235
Copy link
Author

C11235 commented Sep 25, 2023

Thank you!

@Rello Rello removed the pending release part of the next release version label Oct 1, 2023
@Rello Rello closed this as completed Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants