Discussions

Ask a Question
Back to All

401 Unauthorized in /v1/recruiting/applications

Hi there,

I've registered as a trial user (see previous discussion 1 and am trying to push applications (and/or applications/documents)) into the Recruiting API.

Unfortunately I can't seem to get past the authorization and only ever get 401 responses (unless the request is broken, like missing fields, then it's at least a 400 response...)

I'm using the Recruiting API key and Company ID I got from "https://{YOUR_COMPANY}.personio.de/configuration/api/credentials/management".

I've tried to implement the exact same PHP code examples described in the API documenation 2 but no luck.

Entering the data within the API documentation and using the "Try it" option also responds with 401.

Here is the rough, basic example PHP I tried:

$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.personio.de/v1/recruiting/applications', [
    'body' => '{"first_name":"Stefan","last_name":"Reichelt","email":"[email protected]","job_position_id":916607}',
    'headers' => [
        'X-Company-ID' => '123456',
        'accept' => 'application/json',
        'content-type' => 'application/json',
        'authorization' => 'Bearer 1234567890',
    ],
]);

// thrown exception: "Client error: `POST https://api.personio.de/v1/recruiting/applications` resulted in a `401 Unauthorized` response"

Actual Company-ID & API-Key omitted for obvious reasons.
I've registered the Trial-Account with the same Email-Adress as this post, so you can probably find the info on your end.

Anyway, not sure what else to do now. :(

Probably something really small & easy I'm overlooking?
Or is it not possible to push into the Recruitment API as a trial user?

Thanks in advance and
kind regards
Stefan Reichelt

PS: I've found another documentation from you guys concerning the Recruiting API: 3.
It explains the authorization differently (auth_token & company_id as body parameters).
I tried that one too, of course, but same 401 reponse.
Did not expect it to work, but I figure I should mention it, since that documentation and the api documentation should probably explain the same authorization process.