Discussions

Ask a Question
Back to All

Can't pass categorised_documents to Applicant API

(edited)

Dear Personio team,

We're trying to implement uploading of categorised_documents through applicant API.

We have a request formed with formData, required fields are populated and the submission works. However, just adding the categorised_documents field with an empty array, the API does not work anymore. Filling the array with documents in the specified format (object with file and category) does not work either.

The pseudocode looks like this (Node):

const categorised = [];
const personioFormData = new FormData();
        personioFormData.append(
          "categorised_documents",
          JSON.stringify(categorised)
        );
``` 

Error that is returned is 

{"success":false,"error":{"code":0,"message":"Argument 1 passed to Personio\Recruiting\Api\Services\ApplicationService::Personio\Recruiting\Api\Services\{closure}() must be of the type array, string given"}}


Can you please check what is wrong?