Retrieve submission data as JSON

As I see, you can't retrive submission as json, only xml or donwload as csv.
Did you succeeded to retrieve JSON format and how?

Thanks in advance

Hi @Hrvoje_Lovric ,

default format when you pull data from central is json.
This request (Submissions without extension .xml or .csv extension) returns a json :

curl -X GET "https://youcentral.domain/v1/projects/5/forms/CMR_captures.svc/Submissions" -H 'Authorization: Bearer xxxxxxxx'

Ok, but that GET returns JSON without data from form, for data you must add at end instanceID like,
https://youcentral.domain/v1/projects/5/forms/CMR_captures.svc/**uuid:1f01a686-dbcd-46b5-aeb0-ecdab415cfc9.xml**
Without .xml at end of uuid you still don't have data from form.
Using latest central.
From documentation
Getting Submission metadata
GET /v1/projects/{projectId}/forms/{xmlFormId}/submissions/{instanceId}

To retrieve submission data as JSON, use the OData endpoint. https://docs.getodk.org/central-api-odata-endpoints/#data-document has more.

1 Like