Hi @paulsermon, you can take either route to update your form.
- Upload via API: I also couldn’t find documentation, but you can do the following. If your current project has the asset UID of
aW5HJb2gDhpATTaAAHZdxB
and you want to replace the current form with a new form of namenew-form.xlsx
(with a local path of/path/to
):
curl -X POST https://kf.kobotoolbox.org/api/v2/imports/ \
-F file=@/path/to/new-form.xlsx \
-F destination=https://kf.kobotoolbox.org/api/v2/assets/aW5HJb2gDhpATTaAAHZdxB/ \
-H "Authorization: Token <your secret token>"
You should get a JSON response from the request that looks something like:
{
"uid": "it76ukZ57Ks3oSEYrgyTzC",
"url": "https://kf.kobotoolbox.org/api/v2/imports/it76ukZ57Ks3oSEYrgyTzC/",
"status": "processing"
}
- You can update the form with a
PATCH
request directly tohttps://kf.kobotoolbox.org/api/v2/assets/aW5HJb2gDhpATTaAAHZdxB/
, updating thecontent
with your new form in JSON format.
Note that for either of these routes, you need to redeploy the project to make it live (you can do this through the API too). An example of this and other useful API tricks can be seen here: