Need ODK-backend to provide count data of submissions by project Id

What high-level problem are you trying to solve?
I am trying to give data insights on how many submission has been completed in forms and overall project
Any ideas on how ODK could help you solve it?
if we can add an API to get submission counts based on project or forms it will significantly give higher value to a product we are building for Field Mapping Tasking Manager
Upload any helpful links, sketches, and videos.

Hi and welcome, @varun2948!

The ODK Central frontend uses the same ODK Central API that any other system has access to so in general, if you see functionality in the frontend, it's accessible to your application from the backend.

To get the submission count for a given form, you can see docs on getting form details. Note that you will need to send the X-Extended-Metadata: true header.

You can also load a page that has a submission count in the frontend (e.g. https://<your domain>/#/projects/<projectid>/forms/<formid>) and use the network inspector to see what API calls are made.

1 Like

hi @LN we tried with the X-Extended-Metadata : true header but it dint work at all and it is not showing any submission count can u let me know if this is a bug on the odk central-backend

If there were a bug in central backend, the frontend wouldn't be able to show submission counts! Maybe you can share what you've tried and we can try to help.

@LN I just tried the and it didn't give me the payload with submission count for forms I have added X-Extended-Metadata true aswell on the header

  "projectId": 1,
  "xmlFormId": "simple",
  "name": "Simple",
  "version": "2.1",
  "enketoId": "abcdef",
  "hash": "51a93eab3a1974dbffc4c7913fa5a16a",
  "keyId": 3,
  "state": "open",
  "publishedAt": "2018-01-21T00:04:11.153Z",
  "createdAt": "2018-01-19T23:58:03.395Z",
  "updatedAt": "2018-03-21T12:45:02.312Z"


For me this works in PHP, just like you pass token:
$tokeni = "Authorization: Bearer ".$token;
$type = "X-Extended-Metadata: true";

then: curl_setopt($ch, CURLOPT_HTTPHEADER, array($tokeni ,$type ));

I do hope it helps.


1 Like