Data Document
A data document is the straightforward JSON representation of all the Entities in a Dataset.
The $top and $skip querystring parameters, specified by OData, apply limit and offset operations to the data, respectively. The $count parameter, also an OData standard, will annotate the response data with the total row count, regardless of the scoping requested by $top and $skip. If $top parameter is provided in the request then the response will include @odata.nextLink that you can use as is to fetch the next set of data. As of ODK Central v2023.4, @odata.nextLink contains a $skiptoken (an opaque cursor) to better paginate around deleted Entities.
The $filter querystring parameter can be used to filter certain data fields in the system-level schema, but not the Dataset properties. The operators lt, le, eq, ne, ge, gt, not, and, and or are supported. The built-in functions now, year, month, day, hour, minute, second are supported.
The fields you can query against are as follows:
| Entity Metadata | OData Field Name |
|---|---|
| Entity UUID | __id |
| Entity Creator Actor ID | __system/creatorId |
| Entity Timestamp | __system/createdAt |
| Entity Update Timestamp | __system/updatedAt |
| Entity Conflict | __system/conflict |
| Entity Delete Timestamp | __system/deletedAt |
Note that createdAt, updatedAt and deletedAt are time components. This means that any comparisons you make need to account for the full time of the entity. It might seem like $filter=__system/createdAt le 2020-01-31 would return all results on or before 31 Jan 2020, but in fact only entities made before midnight of that day would be accepted. To include all of the month of January, you need to filter by either $filter=__system/createdAt lt 2020-02-01T00:00:00.000Z or $filter=__system/createdAt lt 2020-02-01. Remember also that you can query by a specific timezone.
Please see the OData documentation on $filter operations and functions for more information.
The $select query parameter will return just the fields you specify and is supported on __id, __system, __system/creatorId, __system/createdAt and __system/updatedAt, as well as on user defined properties.
The $orderby query parameter will return Entities sorted by different fields, which come from the same list used by $filter, as noted above. The order can be specified as ASC (ascending) or DESC (descending), which are case-insensitive. Multiple sort expressions can be used together, separated by commas, e.g. $orderby=__system/creatorId ASC, __system/conflict DESC.
The $search query parameter can be used to search entity data (user-defined properties) and the label field. Central does not implement the OData specification's suggested search techniques—such as AND, NOT, and parentheses grouping—exactly as described. Instead, the search behavior is similar to that of a web search engine:
- Multiple words return entities that contain all the searched words (logical AND operation).
- The OR keyword can be used to find entities that contain any of the searched words.
- Quoted text (e.g., "quoted text") searches for entities containing the exact phrase.
- A dash (-) before a word excludes entities that contain that word (logical NOT).
The viewAs query parameter can be used to preview what a specific Actor would receive, based on the Dataset's access filter (ownerOnly or property rules). Pass a numeric Actor ID as the value. This is intended to preview what an App User or Public Link would see when fetching these Entities as a Form Attachment. This parameter can be combined with other filters, e.g. to see the subset of an Actor's Entities that also match a given $filter or $search expression.
As the vast majority of clients only support the JSON OData format, that is the only format ODK Central offers.
Path parameters
The numeric ID of the Project
Name of the Dataset
Query parameters
If supplied, the first $skip rows will be omitted from the results.
If supplied, only up to $top rows will be returned in the results.
If set to true, an @odata.count property will be added to the result indicating the total number of rows, ignoring the above paging parameters.
If provided, will filter responses to those matching the query. Only certain fields are available to reference. The operators lt, le, eq, neq, ge, gt, not, and, and or are supported, and the built-in functions now, year, month, day, hour, minute, second.
If provided, will sort responses according to specified order expression. Only the same fields as $filter above can be used to sort. Multiple expressions can be used together.
If provided, will return only the selected fields.
Opaque cursor from @odata.nextLink used for paging.
If provided, filters the response to only the Entities that the specified Actor would be able to see, based on the Dataset's access filter (ownerOnly or property rules). The value must be a numeric Actor ID.
This is intended for previewing what a particular App User or Public Link would receive when downloading the Dataset via a linked Form Attachment.
Response
Ok
Changes
Changed in 4 of the 54 revisions of this API.5
- ○
added the new optional
queryrequest parameterviewAsnew-optional-request-parameter
- ○
- ○
api operation id
Data Document for Datasetremoved and replaced withdataDocumentForDatasetapi-operation-id-removed
- ○
- ○
removed the non-success response with the status
403response-non-success-status-removed
- ○
- ○
api operation id
dataDocumentForDatasetremoved and replaced withData Document for Datasetapi-operation-id-removed
- ○
added the non-success response with the status
403response-non-success-status-added
This revision also has 11 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○