Survey data

Get a specific submission

{id} can be:

  • The primary key of the submission
  • Its _uuid <sup>1</sup>
  • Its rootUuid (without "uuid:" prefix)

<sup>1</sup> Please note that using the _uuid may match several submissions, only the first match will be returned.

It is also possible to specify the format.

curl -X GET https://kf.kobotoolbox.org/api/v2/assets/{uid_asset}/data/{id}.xml
curl -X GET https://kf.kobotoolbox.org/api/v2/assets/{uid_asset}/data/{id}.json

or

curl -X GET https://kf.kobotoolbox.org/api/v2/assets/{uid_asset}/data/{id}/?format=xml
curl -X GET https://kf.kobotoolbox.org/api/v2/assets/{uid_asset}/data/{id}/?format=json

⚠️ Note: DRF-Spectacular Limitation

Due to limitations in DRF-Spectacular, the ACCEPT headers do not sync properly with the request. As a result, all responses will default to application/json, regardless of the specified format.

This means that while alternative formats (like XML) are technically supported and will work via command-line tools (e.g., curl), they will not work when trying out the endpoint directly from the documentation page.

We’ve still included the header to show supported formats, but keep in mind: Only application/json will be used in the docs UI.

get/api/v2/assets/{uid_asset}/data/{id}/

Request

  • The document declares no server URL.
  • Auth: one of:
    • HTTP basic
    • API key in header Authorization

Path parameters

idstring required

Integer ID (PK) or rootUuid

uid_assetstring required

UID of the parent asset

Query parameters

format'geojson' | 'json' | 'xml'

Response

_idinteger required
formhub/uuidstring
__version__string required
meta/instanceIDstring required
meta/rootUuidstring required
meta/deprecatedIDstring
meta/formVersionsstring
_xform_id_stringstring required
_uuidstring required
_statusstring required
_geolocationnumber[] required
_submission_timestring date-time required
_submitted_bystring required

Example response

{
  "_attachments": [
    {
      "download_url": "https://kf.kobotoolbox.org/api/v2/assets/aTPPUDScaFZkvBzd8FyK4Q/data/18/attachments/1",
      "download_large_url": "https://kf.kobotoolbox.org/api/v2/assets/aTPPUDScaFZkvBzd8FyK4Q/data/18/attachments/attWNZNwhXK6HDYVkZJSn9jy/large/",
      "download_medium_url": "https://kf.kobotoolbox.org/api/v2/assets/aTPPUDScaFZkvBzd8FyK4Q/data/18/attachments/attWNZNwhXK6HDYVkZJSn9jy/medium/",
      "download_small_url": "https://kf.kobotoolbox.org/api/v2/assets/aTPPUDScaFZkvBzd8FyK4Q/data/18/attachments/attWNZNwhXK6HDYVkZJSn9jy/small/",
      "mimetype": "image/png"
    }
  ]
}

Changes

    • info

      added the optional property / to the response with the status (media type: application/json)

    • info

      added the optional property / to the response with the status (media type: text/xml)

    • breaking

      response property _supplementalDetails list-of-types was widened by adding types null to media type application/json of response 200