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

dataviews on ona not working #1

@hallahan

Description

@hallahan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions