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

**URL:** <https://forum.communityhealthtoolkit.org/t/get-api-v1-forms-endpoint-not-returning-json-forms/990>\
**Category:** Development\
**Tags:** medic-api, interoperability, api, integrations\
**Created:** [October 28, 2020, 11:44am UTC](https://forum.communityhealthtoolkit.org/t/get-api-v1-forms-endpoint-not-returning-json-forms/990 "2020-10-28T11:44:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/michael/32/319_2.png) [@michael](https://forum.communityhealthtoolkit.org/u/michael)\
**Post date:** [October 28, 2020, 11:44am UTC](https://forum.communityhealthtoolkit.org/t/get-api-v1-forms-endpoint-not-returning-json-forms/990/1 "2020-10-28T11:44:26Z")

</div>

I’m calling the [GET api/v1/forms](https://docs.communityhealthtoolkit.org/apps/reference/api/#get-apiv1forms) 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](https://docs.communityhealthtoolkit.org/apps/reference/app-settings/forms/#app_settingsjson-forms). Is that intentional?

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [October 28, 2020, 12:54pm UTC](https://forum.communityhealthtoolkit.org/t/get-api-v1-forms-endpoint-not-returning-json-forms/990/2 "2020-10-28T12:54:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![michael](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/michael/32/319_2.png) [@michael](https://forum.communityhealthtoolkit.org/u/michael)\
**Post date:** [October 28, 2020, 3:29pm UTC](https://forum.communityhealthtoolkit.org/t/get-api-v1-forms-endpoint-not-returning-json-forms/990/3 "2020-10-28T15:29:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [October 28, 2020, 3:47pm UTC](https://forum.communityhealthtoolkit.org/t/get-api-v1-forms-endpoint-not-returning-json-forms/990/4 "2020-10-28T15:47:46Z")

</div>

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

> <https://github.com/medic/cht-core/blob/master/api/src/controllers/forms.js#L53>

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.

---

<div class="post-metadata">

**Author:** ![marc](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/marc/32/602_2.png) [@marc](https://forum.communityhealthtoolkit.org/u/marc)\
**Post date:** [October 28, 2020, 6:46pm UTC](https://forum.communityhealthtoolkit.org/t/get-api-v1-forms-endpoint-not-returning-json-forms/990/5 "2020-10-28T18:46:57Z")

</div>

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](https://docs.getodk.org/openrosa-form-list/).
