riigikogu-kantselei / api

Public issue tracker for Open data API at the Chancellery of the Riigikogu
https://api.riigikogu.ee/
GNU General Public License v3.0
10 stars 0 forks source link

Collective addresses' response missing link to initiative document #14

Open moll opened 5 years ago

moll commented 5 years ago

Hey,

We're trying to show all initiatives, incl. ones sent on paper, on https://rahvaalgatus.ee for citizens to read and monitor. However, the API's response for initiatives is missing a link to the initiative document itself. Take https://aavik.riigikogu.ee/api/documents/collective-addresses/34a281e2-bd6c-449a-81d4-6d6be5e319a0 (and its web variant on https://www.riigikogu.ee/tegevus/dokumendiregister/dokument/34a281e2-bd6c-449a-81d4-6d6be5e319a0) for example. All it has is its title, sender and two status messages — skipping the most important document — the initiative PDF.

I hope this is not by design. Thanks!

janesmae commented 5 years ago

FYI, the issue is technically not a feature or enhancement request but the resulting development is.

moll commented 5 years ago

I accidentally stumbled upon requesting an initiative again through /api/documents/:uuid (not /api/documents/collective-addresses/:uuid and found out it contained the original initiative file itself. https://api.riigikogu.ee/api/documents/34a281e2-bd6c-449a-81d4-6d6be5e319a0 vs https://api.riigikogu.ee/api/documents/collective-addresses/34a281e2-bd6c-449a-81d4-6d6be5e319a0, for example. That's not at all intuitive. How did collective-addresses end up returning partial data? The collection resource (/api/documents/collective-addresses) doesn't return files either. I think its response should be equivalent to individual /api/documents/:uuid responses.

janesmae commented 5 years ago

Tag: @marmoluik

moll commented 5 years ago

There are more discrepancies — the /api/documents/:uuid result includes an empty statuses array whereas the collective-addresses/:uuid one reflects the actual statuses, if there are any. It'd be one thing if it were missing entirely, but being empty is confusing.

https://api.riigikogu.ee/api/documents/ae292221-8968-4c48-ad8e-71213dba5622 https://api.riigikogu.ee/api/documents/collective-addresses/ae292221-8968-4c48-ad8e-71213dba5622

The current situation means that to get a complete picture, one would have to iterate over the result of collective-addresses and request every document separately to get the complete info.