API v2 querying by _submission_date

Hello!

I am trying to find a way to query the v2 api in order to get all submissions of a form that have occured past a certain date.

My use case:
I want to get a list of submissions that occured past date t1 in order to integrate with Metabase and display the processed data in some dashboards.

After that I want to use that t1 as a delta so that in the future I can query for data that was create after this new t

From what I can see in the api docs, it doesn’t seem expose any endpoints that can do this. I have found some other topics about this but they all refer to the v1.

Could you please help me with some info regarding this use case?

Hi @alexcontu, This is an option i can suggest by using API v2. You can create a query API (https://www.mongodb.com/docs/manual/reference/operator/query/ ,
Formhub Access Points (API) · SEL-Columbia/formhub Wiki · GitHub ,
KoboToolbox Form Building API). But the problem i face here is you can export the data as JSON, so if you are familiar with JSON, i believe you can use this method, You can find an example code below for your use. why i use $gt? you can find the answer in Mangodb link.

[kpi]/api/v2/assets/{fom uid}/data.json?query={“_submission_time”: {“$gt”: “2023-07-13T09:00:0+0000”}}

1 Like

@alexcontu, FYR here is also a workaround that should help you solve your issue …

Thank you for the answers. I went with the first answear, since I need to integrate with a Spring backend and have this action happen on a scheduled basis.

Also, thank you for mentioning a workaround, I will keep this in mind should we need that approach in the future.

Have a nice day!