Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 19 Next »

Purpose: Get a list of form submissions.

Base URL: https://www.commcarehq.org/a/[domain]/api/v0.5/form/

Input parameters:

The forms can be filtered using the following parameters, which also control paging of the output records.

NameDescriptionExample
xmlns

Form XML namespace (optional)

For help looking up a form's XMLNS see Finding a Form's XMLNS

xmlns=http://openrosa.org/formdesigner/dd3190c7dd7e9e7d469a9705709f2f6b4e27f1d8

limitThe maximum number of records to return. Default: 20. Maximum: 1000limit=100
offsetThe number of records to offset in the results. Default: 0.offset=100
indexed_on_startA date (and time). Will return only forms that have had data modified since the passed in date. This is the recommended field to use for pagination.indexed_on_start=2021-01-01 (or with time 2021-01-01T06:05:42)
indexed_on_endA date (and time). Will return only forms that have had data modified before the passed in date. indexed_on_end=2021-01-01 (or with time 2021-01-01T06:05:42)
received_on_startA date (and time). Will return only forms that were received after the passed in date.received_on_start=2012-01-01 (or with time 2012-01-01T06:05:42)
received_on_endA date (and time). Will return only forms that were received before the passed in date.received_on_end=2013-02-03 (or with time 2013-11-25T06:05:42)
appVersionThe exact version of the CommCare application used to submit the form (this will be large and involved; it is intended for programmatic use)appVersion=v2.6.1%20(3b8ee4-e3dc9f-unvers-2.1.0-Nokia%2FS40-native-input)%20build%207313%20App%20%237300%20b%3A2013-Jun-04%20r%3A2013-Jul-18
include_archivedWhen set to 'true' archived forms will be included in the response.include_archived=true
app_idThe returned records will be limited to the application definedapp_id=02bf50ab803a89ea4963799362874f0c
indexed_onThe returned records will be ordered according to indexed_on date, starting from the oldest dateorder_by=indexed_on
server_modified_onThe returned records will be ordered according to server_modified_on date, starting from the oldest dateorder_by=server_modified_on
received_onThe returned records will be ordered according to server received_on date, starting from the oldest dateorder_by=received_on
case_idA case UUID.  Will only return forms which updated that case.
case_id=4cf7736e-2cc7-4d46-88e3-4b288b403362

Sample usage:

https://www.commcarehq.org/a/[domain]/api/v0.5/form/

Sample output:

{
  "meta": {
    "limit": 20,
    "next": "/a/corpora/api/v0.5/form/?limit=20&offset=20",
    "offset": 0,
    "previous": null,
    "total_count": 6909
  },
  "objects": [
    {
      "app_id": "effb341b",
      "archived": false,
      "attachments": {
        "form.xml": {
          "content_type": "text/xml",
          "length": 1103
        }
      },
      "build_id": "e0a6125",
      "domain": "my-project",
      "form": {
        "#type": "data",
        "@name": "Case Update",
        "@uiVersion": "1",
        "@version": "18",
        "@xmlns": "http://openrosa.org/formdesigner/4281EB62-46E6-49AD-A08C",
        "case": {
          "@case_id": "b6996b7b-6b3f-476a-9006",
          "@date_modified": "2016-11-29T14:50:41.156000Z",
          "@user_id": "e7ad965c",
          "@xmlns": "http://commcarehq.org/case/transaction/v2",
          "update": {
            "data_node": "55",
            "dateval": "2012-09-26",
            "geodata": "5.0 5.0 5.0 5.0",
            "intval": "5",
            "multiselect": "b",
            "singleselect": "b",
            "text": "TEST"
          }
        },
        "data_node": "55",
        "geodata": "5.0 5.0 5.0 5.0",
        "meta": {
          "@xmlns": "http://openrosa.org/jr/xforms",
          "appVersion": "CommCare Android, version \"2.31.0\"(423345). App v18. CommCare Version 2.31. Build 423345, built on: 2016-11-02",
          "app_build_version": 18,
          "commcare_version": "2.31.0",
          "deviceID": "358001070684648",
          "geo_point": null,
          "instanceID": "f959449c-8776-42ac-b776-3f564fafc331",
          "timeEnd": "2016-11-29T14:50:41.156000Z",
          "timeStart": "2016-11-29T14:50:36.155000Z",
          "userID": "e7ad965c70802884a7a67add763939e8",
          "username": "testuser"
        },
        "old_data_node": "",
        "question1": "OK",
        "question11": "5",
        "question12": "2012-09-26",
        "question14": "OK",
        "question3": "b",
        "question7": "b",
        "text": "TEST"
      },
      "id": "f959449c-8776-42ac-b776-3f564fafc331",
      "initial_processing_complete": true,
      "is_phone_submission": "2.0",
      "metadata": {
        "appVersion": "CommCare Android, version \"2.31.0\"(423345). App v18. CommCare Version 2.31. Build 423345, built on: 2016-11-02",
        "app_build_version": 18,
        "commcare_version": "2.31.0",
        "deprecatedID": null,
        "deviceID": "358001070684648",
        "doc_type": "Metadata",
        "geo_point": null,
        "instanceID": "f959449c-8776-42ac-b776-3f564fafc331",
        "location": null,
        "timeEnd": "2016-11-29T14:50:41.156000",
        "timeStart": "2016-11-29T14:50:36.155000",
        "userID": "e7ad965c70802884a7a67add763939e8",
        "username": "simon"
      },
      "problem": null,
      "received_on": "2016-11-29T14:50:42.530616Z",
      "resource_uri": "",
      "server_modified_on": "2016-11-29T14:50:42.530616Z",
      "type": "data",
      "uiversion": "1",
      "version": "18"
    }
  ]
}
  • No labels