Discussions
Field ‚id‘ is required
over 1 year ago by Andreas Bücking
I am trying to fire an application with the following code.
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.personio.de/v1/recruiting/applications', [
'body' => '{"phase":{"type":"system"},"first_name":"Hans","last_name":"Wurst","email":"[email protected]","job_position_id":1170367}',
'headers' => [
'X-Company-ID' => 'XXXXXX',
'accept' => 'application/json',
'authorization' => 'Bearer XXXXXXXXXXXXXXX',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
But I always get the following error
{
"error": {
"reason": "Field 'id' is required"
}
}
What is going wrong?