Hello KoboToolbox team,
I am using the KoboToolbox API v2 to upload converted XLSForms into Kobo. The upload works successfully, but the forms are created under the default My Projects space of the API token user.
In the Kobo UI, the account has multiple project spaces in the dropdown, for example:
My Projects
xyz Projects
In another account, the spaces are named by country/location, for example:
My Projects
country A space
Currently my script creates the asset like this:
POST /api/v2/assets/?format=json
{
"name": "Form Name",
"asset_type": "survey"
}
Then it imports the XLSForm using:
POST /api/v2/imports/?format=json
destination = /api/v2/assets/{asset_uid}/
This uploads correctly, but always into the default My Projects area.
I can see the organization through:
GET /api/v2/organizations/
Example organization result:
name: name_of_organization
id: org_unique_id
My question is:
How can I create or upload an XLSForm directly into a specific project space such as Trocaire Projects or a country/location space, instead of the token user’s default My Projects?
Specifically:
-
Is there a field such as
owner,organization,parent, or another parameter that should be passed when creating the asset? -
Should assets be created through an organization-specific endpoint?
-
If the project spaces are country/location spaces, are these separate Kobo users, organization teams, or collections?
-
Is it possible to move an already-created asset from My Projects into another project space using the API?
Any example API request would be very helpful.
Thank you.
