Restore Deleted Forms by numeric ID. ODK Central API

1. What is the issue? Please be detailed.
I am building a PHP Library to interact with the ODK Central API.
Under Forms>Individual Forms there's an endpoint "Restoring a Form" which is a POST requiring a Project Id and a Form Id, but the documentation specifies it needs the numeric ID of the Form provided within the /forms endpoint, but that endpoint does not returns the numeric ID, not even with the "X-Extended-Metadata" header.
My ODK Central client and server are both v2024.1.0, I assume the API version I am using is the current since is the one in the website.
Something that might be important is that the Forms where created and used on the field over the v1.2 of ODK Central and was just recently that we upgraded to the last version.

2. What steps can we take to reproduce this issue?
Well, I think just use the /forms endpoint and confirm it does not retrieve a numeric value for any form.

3. What have you tried to fix the issue?
Other than adding the extended metadata header, I don't know what else to do.

4. Upload any forms or screenshots you can share publicly below.

Hi @JoseRodriguez,

The numeric form ID will be returned for deleted forms if you include ?deleted=true in the same form list endpoint you're using above. (This code, if you are curious.)

We were trying to minimize usage of numeric IDs within the API, so we chose to only expose this ID when necessary for restoring soft-deleted forms.

I realize this is not well-described in the documentation either about restoring a form or fetching deleted forms. Sorry about that!


That is awesome, thank you very much, the numeric ID is now returned.
Yes the documentation does not mentioned it, but it made sense to use the numeric ID for restoring a soft deleted form, so I felt something was missing.

1 Like