Hi @mkmortera, ok I understand what you’re trying to do. Unfortunately it’s a bit more involved than that — the xls_link
is generated internally and is not the URL-linked xlsform. There are three steps you need to follow to replace and redeploy a form:
- Replace the form, with a URL-linked form in your case:
curl -X POST 'http://<kf url>/api/v2/imports/' \
-F "destination=http://<kf url>/api/v2/assets/<asset uid>/" \
-F url=https://docs.google.com/spreadsheets/d/e/.../pub\?output\=xlsx \
-F "name=<project name>" \
-H "Authorization: Token <token>"
- Get the
version_id
from theasset
:
curl http://<kf url>/api/v2/assets/<asset uid>.json \
-H "Authorization: Token <token>" \
| jq ".version_id"
- Redeploy the
asset
with the newversion_id
:
curl -X PATCH http://<kf urld>/api/v2/assets/<asset uid>/deployment/ \
-F active=true \
-F version_id=<version id> \
-H "Authorization: Token <token>" \
-H 'Accept: application/json'
If you are wanting to go the form media route rather than replacing the form itself, then that is the correct thread to follow. In essence: to update the media you need to delete the existing media file and then replace it with the updated one.