Kobo API get last submission (descending order)

Good day, colleagues!

I want to take last 900 submissions but using the following endpoint I got the first 900. Could you help me with the sort or something like that?


@slovak82, you could use sort={"<field name>": <order>} at the end of the URL, where <field name> is the question name as it appears in the API output, and <order> is 1 for ascending and -1 for descending. For example:

https://kf.kobotoolbox.org/api/v2/assets/abcdef@@@@@@ghijkl7890/data.json?sort={"_id": 1}
https://kf.kobotoolbox.org/api/v2/assets/abcdef@@@@@@ghijkl7890/data.json?sort={"_id": -1}

thank you so much!

1 Like