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

Datastore API issue #4052

Closed
DaniyalRaza786 opened this issue Nov 7, 2023 · 2 comments
Closed

Datastore API issue #4052

DaniyalRaza786 opened this issue Nov 7, 2023 · 2 comments

Comments

@DaniyalRaza786
Copy link

I want to fetch all the data from the resource files at once. So we tried /API/1/datastore/query with the 'GET' method as mentioned in the documentation, but it gave an empty result on the demo.getdkan.com website. How can I resolve this issue? And the second thing is datastore API show only CSV file's data, but we need to show CSV and excel file how can I fetch for both file data at a time if have any possibilities please suggest me.

PFA
Screenshot from 2023-11-07 14-48-09
Screenshot from 2023-11-07 14-45-31

@github-actions github-actions bot added this to Incoming/Triage in DKAN 2 Issue Triage Nov 7, 2023
@dafeder
Copy link
Member

dafeder commented Dec 9, 2023

Hi @DaniyalRaza786. You need to provide an identifier to the datastore API so that it can know what table to show. Usually this is done by adding it directly to the endpoint, so api/1/datastore/query/[distribution-id] or api/1/datastore/query/[dataset-id]/[index] - the index being which number in the distribution array your table occupies (often "0").

So for instance for

https://demo.getdkan.org/dataset/5dc1cfcf-8028-476c-a020-f58ec6dd621c

We can query

https://demo.getdkan.org/api/1/datastore/query/5dc1cfcf-8028-476c-a020-f58ec6dd621c/0

The datastore can only run queries on resources that have been imported to the database. At the moment, DKAN can only import CSV files.

@dafeder
Copy link
Member

dafeder commented Apr 5, 2024

Closing this, assuming its resolved

@dafeder dafeder closed this as completed Apr 5, 2024
DKAN 2 Issue Triage automation moved this from Incoming/Triage to Closed Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants