$client = new Client();
$endpoint = $baseUrl."/oauth/token";
$response = $client->request('POST', $endpoint, [
'debug' => true,
'header' => [
'Content-type' => 'application-json',
],
'auth' => [$clientId, $clientSecret],
'form_params' => ['gran_type' => 'client_credentials'],
'cert' => $certificate
]);