Hi all,
I'm having some issues sending data to CommCareHQ. The data I am trying to upload is an xls file with the endpoint bulk_upload_api (Bulk Upload Case Data - CommCare Public - Dimagi Confluence) using axios. For some reason, I don't have to store the file in the filesystem, but I'm sending the streams (build from a buffer using the npm package xlsx).
The response I'm having from CommCare is this line:
data: { code: 500, message: "Error: Invalid POST request. Both 'file' and 'case_type' are required" }
...even though I append the file (buffer) and the case_type. Check snippet below:
let data = new FormData(); data.append('file', buffer); data.append('case_type', 'xxx'); data.append('search_field', 'external_id'); data.append('create_new_cases', 'on');
Anyone has evey tried this way of uploading case and could help?