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

Expose a CSV API endpoint of our aggregated drawings data to use with the HXL Proxy #147

Open
2 tasks done
krissy opened this issue Jan 22, 2017 · 0 comments
Open
2 tasks done

Comments

@krissy
Copy link
Member

krissy commented Jan 22, 2017

Semi-blocked by: #146, #145
Relates to: #160

What

We are integrating with the Humanitarian Data Exchange (HDX) - see the project/milestone description for background.

As a first step, we want to expose a public .csv endpoint holding data that conveys the "Number of displaced children and their conveyed moods in art therapy".

This will display HXL-formatted content using the database view we created in #145. Once this endpoint is ready, we can use it as a source to create a new HXL Proxy API, which will serve a JSON endpoint for our data visualization graphs to use going forward.

Please refer to the data in #146 for what to replicate. You can also check out the ticket details in #160 to see how this will eventually be used for context.

NB: Though this is blocked by completion of #146, you can already get a start on setting up the new route and CORS fix specified below.

How

  • New endpoint: Refer to this spike PR which currently exposes a HXL-formatted CSV when you access the URL /drawings.csv. Now that the HXL data design doesn't correspond to the drawings#index action, we want to decouple this with the index route and replace this with a separate endpoint that makes sense. E.g. /hdx_report_drawings.csv.
  • Make it (and only it) public. For some reason CORS (cross-origin resource sharing) isn't enabled despite this commit from the original hackathon, and you still have to be logged in to access any of these internal endpoints. This is a "good bug" at the end of the day, because we don't want to expose the drawings until we confirm which drawings we have the consent to expose the data for. However, this particular CSV endpoint CAN be exposed publicly because it's just overall totals and nothing to do with personal information. The ideal task for this is to ensure CORS is disabled for all other endpoints except this one.

Output and Test

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

No branches or pull requests

3 participants