Skip to content
This repository has been archived by the owner on Jun 6, 2019. It is now read-only.

dataviews on ona not working #1

Open
hallahan opened this issue Oct 13, 2015 · 0 comments
Open

dataviews on ona not working #1

hallahan opened this issue Oct 13, 2015 · 0 comments

Comments

@hallahan
Copy link
Contributor

Ona's API specifies that it has a dataview functionality where you can query for specific data. Unfortunately, it does not work. I've tried POSTing a new data view and also viewing the dataviews via GET both on the whitelisted server via curl as well as

https://api.ona.io/static/docs/dataviews.html

We would ideally want to use this rather than the data.json endpoint, because we do not want to fetch all of the data every time.

When trying to post to the http://<url>/api/v1/dataviews endpoint, I get an access denied from Postman on my laptop with at Forbidden CSRF message. So, I know the staging server is whitelisted in the Ona instance, so I tried to post a data view via curl up there.

curl -H "Content-Type: application/json" -H "Authorization: Token <token>" -X POST -d "{'name': 'My DataView', 'xform': 'http://<url>/api/v1/forms/139.json', 'project':  'http://<url>/api/v1/projects/11.json', 'columns': '["_id", "surveyor"]', 'query': '[{"column":"_id", "filter":">", "value":"16"}]'}" http://<url>/api/v1/dataviews

Then, I get no response via CURL. When doing a GET request on that endpoint, I should be getting a list of all of the dataviews. I also get no response there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant