Using Postman to test deploying a project/form via API call.
Using POST to this endpoint:
https://kf.kobotoolbox.org/api/v2/assets/{uid}/deployment/
There are no prior deployments - the form has never been deployed - so according to documentation it should create a new deployment, however, it just archives my project.
Reading the forum, the endpoint for archiving has /data/ between the {uid} and /deployment/ so confused as to why this is happening and what I’m doing wrong.
Please help!
P.S. I am brand new to KoboToolbox - but not to API calls
Welcome to the community, @tsomerfield! Maybe you will also need to pass the --data
parameters like:
--data '{"active":true,"version_id":"v50p3vdCvqqkHboz7er9jh"}'
Thanks @Kal_Lam - seems like a helpful and welcoming one so glad to be here.
Thanks for the tip, I did try each of those parameters but not together. Will try that and feed back.
This hasn’t appeared to work. Can I ask for clarification on how you would pass those parameters in Postman to ensure I’m not missing a small detail?
I was using the query parameters.
Yesterday I tried to pass them in the Body as well as the Header, but neither worked. I probably set them up wrong though.
Solved it!
In the body I simply needed to include the following:
{
“active”: true,
“identifier”: “https://kf.kobotoolbox.org/#/forms/aGNiRRxVx9Cbb7zqQtohiY”,
“version_id”: “vEf5cVkESUgLSNXuvwNjao”
}
Inferred from this thread
Hopefully this helps others! The KoboToolbox documentation could definitely do with more detail.