massgov / massgov/feature-requests

Expose the Content, Document, and Editoria11y Report Views to REST API

Open
#290 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
12
Forks
8
PR merge metrics
No merged PRs in 30d

Description

## Is your feature request related to a problem? Please describe.
For the MA accessibility compliance program, it is crucial for all secretariats to do monthly or bi monthly pulls for all content from Mass.gov to show accessibility progress over time. This is proving to be an extremely manual process as we need to search each agency, and each division, and download the CSV each time for each one. For some secretariats, like EEA, this is an extremely long process due to the amount of organizations that fall within that umbrella.

EEA is currently working on a PowerBI dashboard to pull in these monthly progress updates and we are hoping to do this automatically to avoid the current time waste manual process. The goal is that this dashboard will be a baseline for all secretariats to pull in their information in a more consistent and clean way.

I can currently access the https://www.mass.gov/jsonapi no problem, and I do see access to a view https://www.mass.gov//jsonapi//view//view, but I don't believe this is the view we are looking for (as I cannot see the machine_name for the appropriate views and Many of these say we do not have permissions). So it could just be a permission issue, otherwise you may have to follow the suggestion below.

## Describe the solution you'd like
The current JSON feed does not expose the information for these views. I would like a new exposed API endpoint for the following views:
1. Content (content)
2. Documents (all_documents)
3. Editoria11y Report (accessibility_report_for_authors)
4. Ensure permissions are set for a Developer to be able to GET the information

Having endpoints to these views will make our accessibility Monthly reporting a much smoother process and save time for other important Accessibility initiatives. EEA is currently creating a dashboard for all things accessibility to show progress over time and show complete transparency to all agencies.

## Additional context
From the Drupal standpoint, I believe it should be pretty straight forward, however I do not know the ins and outs of the Mass.gov development setup and current config of course. But from my understanding I would:
1. Enable the core "Rest" module.
2. Create a new View and add a "REST Export" display, or leverage the current view and add a new "REST Export" display mode.
3. Add a path to access the endpoint.
4. Add your fields, filtering, etc. (this should be the same content shown in the current CSV)
5. Leverage https://www.drupal.org/project/rest_views module if you need it for cleaned up data.
6. Ensure permissions are set for a Developer to be able to GET the information

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the existing JSON:API view endpoint and the named views: content, all_documents, and accessibility_report_for_authors. Verify whether REST export endpoints can expose the same fields and CSV data, and determine the permissions needed for Developer GET access. Done means each requested view is available through a documented endpoint with the required access.

Written by the indexing model from the issue text.

Assessment

Domain
accessibility, api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.