How to make an api request for editing a submitted instance

Hi @taufik_maggangka, can you please clarify what you are trying to achieve and where you are stuck :slightly_smiling_face:

1 Like

This is the full url pattern:

(https://kobo.humanitarianresponse.info/api/v2/assets/[uid]/data/[_id]/enketo/edit/?return_url=false)

there are two variables that you need to insert in this url for it to work: the [uid] and the [id].

The [uid] is a string that refers to a specific project. to get the [uid], open your project and check the url that is in the address bar. It should be something like this:
https://kobo.humanitarianresponse.info/#/forms/azq8z4LQhekcmWta8RTyra/summary

The text between ‘forms’ and ‘summary’ is your [uid]

the [id] comes with each submission under the column name [_id]

I create a simple excel function to formulate this url for every submission. It should look something like this: https://kobo.humanitarianresponse.info/api/v2/assets/azq8z4LQhekcmWta8RTyra/data/316312587/enketo/edit/?return_url=false

When clicking the resulting url, it will return another url in the browser (this new one is temporary and works only one time). Copy the emerging url into the address bar and you’ll get to to your submission to edit it.

I hope this helps.

2 Likes

Hi @Josh ,
Basically, I would like to edit kobo submission by API.

I saw your issue that raised, to follow this patten:
/api/v2/assets/{uid}/data/{id}/view/?return_url=false

But dont really understand, it is why I asked for an example.

Hi @taufik_maggangka, if you are wanting to make edits directly through the API (not within Enketo) you can refer to the thread here for more details:

1 Like