Community Health Toolkit

GET /api/v1/forms endpoint not returning JSON forms

I’m calling the GET api/v1/forms endpoint. The documentation says that it “Returns a list of currently installed forms (in all available formats) in JSON format.

From what I can tell, it is not returning JSON forms. Is that intentional?

I traced the code back to 2015 and the endpoint has always only returned a list of xml (enketo) forms.
I believe the reason behind this endpoint existing is integration with medic-collect, which doesn’t support SMS forms.
The list of installed SMS forms is easily visible in the settings doc.

1 Like

Thanks. What do you think “(in all available formats)” is meant to convey? I understood it to mean enketo + JSON forms.

Perhaps we can just update the documentation for that endpoint to clearly indicate that it only includes enketo forms.

The endpoint accepts a header called x-openrosa-version which changes the way the response is formatted. Maybe it was about this?

Or maybe there was general confusion into what the endpoint returned when the documentation was written?

I think it’s safe to update the documentation, unless someone has some history about this endpoint.

1 Like

That’s right, the form list endpoint is used by (Medic) Collect to know which forms are available on the server. It uses that info to then download the individual forms to the device. Looks like we should update the documentation.

There is more up to date info on the form list API in the ODK documentation.