*** Authorization Request in PHP ***| $ch = curl_init('https://sandbox.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials'); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Basic ' . base64_encode('TGPZ2OeQ1Og7wDNZHEmiD7aPeYZMJcQN:EKES9Gr9V2Yk9wve') ]); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); echo json_decode($response);