Having trouble authenticating via API calls


I'm developing a PHP application. I have downloaded the sample files for making API calls from here: https://developer.columbus.sage.com/docs#/es/sageone/accounts/gs-sample-applications
The problem is that when I try accessing the URL generated via the authRedirect() function inside the SageoneClient class, I get this error:

Bad Request: invalid_request

Parameter 'client_id' is invalid.

even though I literally copy-pasted the client id from the application details. Here's a snippet of the code:

$client_id = "copy-pasted client id"; .
$client_secret = 'copy-pasted client secret';
$callback_url = 'sage.mugu.ro/callback.php';
$auth_endpoint = 'www.sageone.com/.../auth';
$token_endpoint = 'https://api.sageone.com/oauth2/token';

$sageone_client = new SageoneClient($client_id, $client_secret, $callback_url, $auth_endpoint, $token_endpoint, $scope);

$redirect_url = $sageone_client->authRedirect();
echo $redirect_url;

How can I solve this problem?