API Explorer

The CommCare API Explorer is a convenient and powerful tool for browsing read-only CommCare APIs. The tool seamlessly integrates with the user's CommCare account using OAuth 2.0 authentication, alleviating any concerns regarding authentication management.

This is especially useful for users who are interested in learning what data points are included in CommCare API requests without setting up a testing environment and associated overheads.

https://www.loom.com/share/1a61fd132dc946518bc6ee698aadaf2c

About the API Explorer

Supported API Outputs

This tool allows users to see outputs for the following APIs:

Getting Started

For using the tool, navigate to and click to authorise CommCare.

Click on Authorize.

Once signed in, select a domain from the dropdown or type it in. Then select the API and click on Request API.

Here’s an example of what an API Request for List Cases would look like.

API Output Sample

{ "meta": { "limit": 20, "next": null, "offset": 0, "previous": null, "total_count": 7 }, "objects": [ { "case_id": "6bf7acb1-b052-4dec-8815-c5d070c0cd51", "closed": false, "closed_by": null, "date_closed": null, "date_modified": "2024-04-11T15:56:41.665000Z", "domain": "rr-api-testing-space", "id": "6bf7acb1-b052-4dec-8815-c5d070c0cd51", "indexed_on": "2024-04-11T15:56:48.315020Z", "indices": {}, "opened_by": "debf49b5bb904ca7b2d3bebe9d84f420", "properties": { "case_name": "Test Case 1", "case_type": "case", "date_opened": "2024-04-11T15:56:41.665000Z", "external_id": null, "owner_id": "debf49b5bb904ca7b2d3bebe9d84f420" }, "resource_uri": "", "server_date_modified": "2024-04-11T15:56:41.799459Z", "server_date_opened": "2024-04-11T15:56:41.799459Z", "user_id": "debf49b5bb904ca7b2d3bebe9d84f420", "xform_ids": [ "3f3c3782-f72e-4ba5-a21d-c351aa9c9719" ] },

Summary

Meta Data

  • Limit: Indicates the maximum number of objects that can be returned in a single response. In this case, it's set to 20.

  • Next: Provides a link to the next page of results. Since it's set to null, there are no more pages of results.

  • Offset: Indicates the offset of the objects returned in the current response. It's set to 0, meaning these are the first objects in the collection.

  • Previous: Provides a link to the previous page of results. Since it's set to null, there are no previous pages.

  • Total Count: Represents the total number of objects in the collection. In this case, it's 7.

Case Information:

  • ID: 6bf7acb1-b052-4dec-8815-c5d070c0cd51

  • Name: Test Case 1

  • Type: case

  • Domain: rr-api-testing-space

  • Opened By User ID: debf49b5bb904ca7b2d3bebe9d84f420

  • Date Opened: April 11, 2024, at 15:56:41 UTC

  • Date Modified: April 11, 2024, at 15:56:41 UTC

  • Closed Status: Not closed

  • Server Date Modified: April 11, 2024, at 15:56:41 UTC

  • Server Date Opened: April 11, 2024, at 15:56:41 UTC

  • User ID: debf49b5bb904ca7b2d3bebe9d84f420

  • Additional Information:

    • Indexed On: April 11, 2024, at 15:56:48 UTC

    • XForm IDs: ["3f3c3782-f72e-4ba5-a21d-c351aa9c9719"]

API Output Sample

{ "meta": { "limit": 20, "next": null, "offset": 0, "previous": null, "total_count": 10 }, "objects": [ { "app_id": "452a9a647ee8f364b1aed887c5a56a4c", "archived": false, "attachments": { "form.xml": { "content_type": "text/xml", "length": 1173, "url": "https://www.commcarehq.org/a/rr-api-testing-space/api/form/attachment/4e81d6bc-2abc-4a52-8a8a-003881f6f64a/form.xml" } }, "build_id": null, "domain": "rr-api-testing-space", "edited_by_user_id": null, "edited_on": "2024-05-22T13:05:12.210675Z", "form": { "#type": "data", "@name": "Registration Form", "@uiVersion": "1", "@version": "26", "@xmlns": "http://openrosa.org/formdesigner/29856D0E-305D-418A-8F6E-41663E4BD30D", "age": "99", "case": { "@case_id": "b159e964-30ef-4cf4-aa68-a906554dca2a", "@date_modified": "2024-05-22T09:41:43.317000Z", "@user_id": "debf49b5bb904ca7b2d3bebe9d84f420", "@xmlns": "http://commcarehq.org/case/transaction/v2", "create": { "case_name": "Data Forwarding Test with Power Automate", "case_type": "case", "owner_id": "452a9a647ee8f364b1aed887c5aab210" },

Summary

  • Meta Data:

    • Limit: The maximum number of objects that can be returned in a single response is set to 20.

    • Next: Points to the next page of results. Since it's set to null, there are no more pages.

    • Offset: Indicates the offset of the objects returned in the current response. It's set to 0, meaning these are the first objects in the collection.

    • Previous: Points to the previous page of results. Since it's set to null, there are no previous pages.

    • Total Count: Indicates that there are a total of 10 objects in the collection.

  • Objects:

    • App ID: Identifies the application associated with the form, here it's "452a9a647ee8f364b1aed887c5a56a4c".

    • Archived: Indicates whether the form is archived or not, set to false.

    • Attachments: Contains attachments associated with the form, here it's a form.xml file with a URL to access it.

    • Build ID: Represents the build ID of the form.

    • Domain: Indicates the domain to which the form belongs, here it's "rr-api-testing-space".

    • Edited By User ID: Represents the user who last edited the form.

    • Edited On: Specifies the timestamp when the form was last edited, set to "2024-05-22T13:05:12.210675Z".

    • Form: Contains details about the form itself:

      • Type: Specifies the type of form data, set to "data".

      • Name: Indicates the name of the form, here it's "Registration Form".

      • UI Version: Specifies the UI version of the form, set to "1".

      • Version: Indicates the version of the form, set to "26".

      • XML Namespace: Specifies the XML namespace of the form.

      • Age: An example field within the form.

    • Case: Contains information about the associated case:

      • Case ID: Identifies the case associated with the form.

      • Date Modified: Specifies the timestamp when the associated case was last modified.

      • User ID: Indicates the user ID associated with the modification of the case.

      • XML Namespace: Specifies the XML namespace of the case transaction.

      • Create: Contains details about the creation of the associated case, including the case name, case type, and owner ID.

API Output Sample

{ "meta": { "limit": 20, "next": null, "offset": 0, "previous": null, "total_count": 2 }, "objects": [ { "default_phone_number": null, "email": "", "eulas": "[]", "first_name": "", "groups": [ "452a9a647ee8f364b1aed887c5aab210" ], "id": "debf49b5bb904ca7b2d3bebe9d84f420", "last_name": "", "phone_numbers": [], "resource_uri": "/a/rr-api-testing-space/api/v0.5/user/debf49b5bb904ca7b2d3bebe9d84f420/", "user_data": { "commcare_profile": "", "commcare_project": "rr-api-testing-space", "role": "dc" }, "username": "user1@rr-api-testing-space.commcarehq.org" },

Summary

  • Meta Data:

    • Limit: The maximum number of objects that can be returned in a single response is set to 20.

    • Next: Points to the next page of results. Since it's set to null, there are no more pages.

    • Offset: Indicates the offset of the objects returned in the current response. It's set to 0, meaning these are the first objects in the collection.

    • Previous: Points to the previous page of results. Since it's set to null, there are no previous pages.

    • Total Count: Indicates that there are a total of 2 objects in the collection.

  • Objects:

    • Default Phone Number: The default phone number associated with the user, currently set to null.

    • Email: The email address of the user, currently an empty string.

    • Eulas: A list of end-user license agreements, currently an empty list.

    • First Name: The first name of the user, currently an empty string.

    • Groups: A list of group IDs to which the user belongs. Here, it contains one group ID: "452a9a647ee8f364b1aed887c5aab210".

    • ID: The unique identifier of the user, set to "debf49b5bb904ca7b2d3bebe9d84f420".

    • Last Name: The last name of the user, currently an empty string.

    • Phone Numbers: A list of phone numbers associated with the user, currently an empty list.

    • Resource URI: A URI pointing to the user's resource.

    • User Data: Additional data associated with the user:

      • CommCare Profile: Currently empty.

      • CommCare Project: Specifies the CommCare project the user belongs to, set to "rr-api-testing-space".

      • Role: Specifies the role of the user, set to "dc".

    • Username: The username of the user, set to "user1@rr-api-testing-space.commcarehq.org".

API Output Sample

Summary

  • Meta Data:

    • Limit: The maximum number of objects that can be returned in a single response is set to 20.

    • Next: Points to the next page of results. Since it's set to null, there are no more pages.

    • Offset: Indicates the offset of the objects returned in the current response. It's set to 0, meaning these are the first objects in the collection.

    • Previous: Points to the previous page of results. Since it's set to null, there are no previous pages.

    • Total Count: Indicates that there are a total of 2 objects in the collection.

  • Objects:

    • Default Phone Number: The default phone number associated with the user, currently set to null.

    • Email: The email address of the user, set to "rrath@dimagi.com".

    • Eulas: A list of end-user license agreements. Each agreement contains information such as the date, type, whether it's signed, user ID, user IP, and version.

    • First Name: The first name of the user, set to "Rishabh".

    • ID: The unique identifier of the user, set to "94162daf38b4793ecad08c4f204512cd".

    • Is Admin: Indicates whether the user is an admin, set to true.

    • Last Name: The last name of the user, set to "Rath".

    • Permissions: Contains a variety of permissions granted to the user, such as access to locations, API, mobile endpoints, release management, web apps, analytics, reports, and more.

    • Phone Numbers: A list of phone numbers associated with the user, currently an empty list.

    • Resource URI: A URI pointing to the user's resource.

    • Role: Specifies the role of the user, set to "Admin".

    • Username: The username of the user, set to "rrath@dimagi.com".

API Output Sample

Summary

  • Meta Data:

    • Limit: The maximum number of objects that can be returned in a single response is not set (null).

    • Next: Points to the next page of results. Since it's set to null, there are no more pages.

    • Offset: Indicates the offset of the objects returned in the current response. It's set to 0, meaning these are the first objects in the collection.

    • Previous: Points to the previous page of results. Since it's set to null, there are no previous pages.

    • Total Count: Indicates that there is a total of 1 object in the collection.

  • Objects:

    • Modules: A list of modules included in the application. Each module contains details such as case properties, case type, forms, and unique ID.

    • Name: The name of the application, set to "App for API Testing".

    • Versions: A list of versions of the application. Each version contains details such as build comment, build timestamp, unique identifier, and whether it's released.

      • Build Comment: A comment regarding the build, currently null.

      • Built On: The timestamp when this version was built, currently null.

      • ID: The unique identifier of the application, set to "452a9a647ee8f364b1aed887c5a56a4c".

      • Is Released: Indicates whether the application version is released, set to false.

      • Version: The version number of the application, set to 26.

Report Explorer

The same link also allows users to look at existing reports and data sources for the domain selected. Users can select any report builder reports from the dropdown and see the output.

Data Source Editor

This is an advanced feature and will require Dimagi support. Please reach out to info@dimagi.com for queries.

Â