Application Document Upload Mimetype
we're trying to upload some documents to the application api and always getting the problem, that the files inside the personio backend does'nt get a correct preview neither can be downloaded correctly.
It seems that the mimetype of the uploaded files get lost, so it's always "text/plain".
We're using PHP with guzzle to request the api and having a nearly similar code like the api documentation example:
<?php require_once('vendor/autoload.php'); $client = new \GuzzleHttp\Client(); $response = $client->request('POST', 'https://api.personio.de/v1/recruiting/applications/documents', [ 'multipart' => [ [ 'name' => 'file', 'filename' => 'gitlab-icon-rgb.png', 'contents' => 'data:image/png;name=gitlab-icon-rgb.png;base64,iVBORw0KGgoAAAANSUhEUg....', 'headers' => [ 'Content-Type' => 'image/png' ] ] ] 'headers' => [ 'Accept' => 'application/json', 'Authorization' => 'Bearer XXX', 'X-Company-ID' => 'XXX', ], ]); echo $response->getBody(); `` When sending this autogenerated code to the api, I'm getting the following result:
So the api is detecting a "text/plain" mimetype, but I was uploading a "image/png" mimetype. What is wrong with the request?