We are implementing an automated data synchronization system for the Maize Observation Network (ROM) in Madagascar.
Our objective is to establish a three-level data management workflow:
- Data collection: Regional enumerators collect and submit survey data through KoboCollect.
- Regional validation: Regional validators review submissions and approve or reject them.
- National consolidation: Only approved submissions should be automatically transferred to a separate national KoboToolbox project.
We have separate source and national KoboToolbox projects for two surveys: Maize Prices and Agricultural Practices and Yield.
We developed a Google Apps Script using the KoboToolbox API v2 and OpenRosa to identify approved submissions and transfer them to the national project.
The script successfully retrieves the data, identifies approved submissions, and prepares the XML using the correct deployed XForm ID.
However, when submitting the approved record to the private national project, the server returns HTTP 403 – Access denied.
We have tested both kf.kobotoolbox.org and kc.kobotoolbox.org. The national projects are deployed and active, the API token works for reading data, and the multipart/form-data request is correctly generated.
We need assistance identifying the cause of HTTP 403 and determining the supported authentication method for submitting records programmatically to a private KoboToolbox project.
Our requirement is to keep the projects private
What’s happening instead?
The source KoboToolbox project contains two maize price survey submissions, including one that has been approved by the regional validator.
Our Google Apps Script successfully:
-
Connects to both source and national KoboToolbox projects using API tokens.
-
Identifies the approved submission.
-
Retrieves the source data and constructs the XML using the destination project’s deployed XForm.
-
Confirms the correct destination Form ID:
aUXBrDoVQCcEAaTi4DuMPx. -
Generates a multipart/form-data POST request containing
xml_submission_file.
However, when attempting to transfer the approved submission, the server returns:
HTTP 403 – Access denied
We tested both kf.kobotoolbox.org/submission and kc.kobotoolbox.org/submission, with the same result.
The national project remains empty, even though it is deployed, active, and accessible through API v2.
The expected result is that the national project receives the approved submission, while the unapproved submission remains exclusively in the source project.
