MOON
Server: Apache
System: Linux e2e-78-16.ssdcloudindia.net 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
User: imensosw (1005)
PHP: 8.0.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/imensosw/public_html/imenso.co/dev/revspring/GetToken.php
<?php

/**
 * 
 */
class GetToken
{
    public function generateToken()
    {
        $tokenUrl = "https://api.qua.truereg.care/patient-access/v1/oauth2/token";

        $tokenHeaders = array(
        'Content-Type: application/x-www-form-urlencoded'
        );

        $ch = curl_init($tokenUrl);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $tokenHeaders);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, "grant_type=client_credentials&client_id=9e6e7268-e327-4b23-9571-38170dd39ed5&client_secret=46220b5a-b444-41e0-9a8b-d931957515ea&scope=visits");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
        $tokenData = curl_exec($ch);
        curl_close($ch);

        return json_decode($tokenData, true);
    }
}
?>