$url = 'https://api-auth.ianum.com/v1_3/oauth/token';
'grant_type' => 'client_credentials',
'client_secret' => 'your-client-secret-key',
'client_id' => 'gate_xxxxxxxxxxxxx' //also the alias is accepted
$data_string = json_encode($data);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-type: application/json",
"Accept: application/json"
$result = curl_exec($ch);
//print the result of the response