If I understand you correctly.
For the first part of your question (n1), you can get the uploaded file using:
$file = $request->file('test'); // where 'test' is the 'name' of this file input
Check more: https://laravel.com/docs/master/requests#retrieving-uploaded-files
For the second part (n2), it looks like you are passing an invalid body. Try this:
$body = [
'documents' => [
[
'language' => 'nl',
'id' => '1',
'text' => $text,
],
]
];
$headers = [
'Ocp-Apim-Subscription-Key' => 'xxxxxxxxxxxxxxxxxxxxxxx',
'Accept' => 'application/json',
'Content-Type' => 'application/json' // this might not be needed since Guzzle should add this automatically
];
$client->request('POST','https://westeurope.api.cognitive.microsoft.com/text/analytics/v2.0/KeyPhrases', [
'json' => $body,
'headers' => $headers,
'debug' => true, // to get more info on the error ...
]);