Use Foreman API with PHP

Hey!

I have a very very begginner question. How can I use Foreman API with only
PHP.

I strated to use curl, but it does not work for me very well.
$curl = curl_init();

$username = 'MyUsername';
$password = 'MyPassword';

curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => false,
CURLOPT_URL => 'https://MyForemanAddres.eu/api/v2/architectures',
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_USERPWD => $username . ":" . $password,
));

$result = curl_exec($curl);
echo var_dump($result);
curl_close($curl);

What I got is only an error message:
{ "error": {"message":"Unable to authenticate user MyUsername"} }

What should I need to do?

Thank you for help.

Best Regards, KOovi

Got it. The Username must be lowercase. What a noob mistake. Thank you.