Discussions

Ask a Question
Back to All

Send attributes to API not working

(edited)

I try to send an application to Personio.
The fields "first_name", "last_name", "email" and custom attributes are working. But how do I transfer "phone", "available_from" and "salary_expectations"?
I tried to use the old variables (https://developer.personio.de/reference#deprecated-applicant) but they are not working.

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.personio.de/v1/recruiting/applications",
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => {"first_name":"Max1","last_name":"Mustermann1","email":"[email protected]","phone":"12335","job_position_id":468746,"available_from":"01.12.21","salary_expectations":"122456","files":[{"uuid":"e05b7d4f-3c21-41aa-b647-1972ec786ebc","original_filename":"Touch\u00a0Bar Bild 2021-12-02 um 09.08.19.png","category":"cv"},{"uuid":"97abeca1-0042-4fc1-ae20-d04f4259d94e","original_filename":"Touch\u00a0Bar Bild 2021-12-02 um 09.08.19.png","category":"other"}],"tags":[],"attributes":[{"id":"custom_attribute_130081","value":"internet"}]}
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $token",
"x-company-id: $company_id",
"Accept: application/json",
"Content-Type: application/json",
],
]);