Hi Ionut,
There were some changes to authentication with the API as of version 6. It’s possible that the documentation you’re looking at was written for version 5.
The discussion on the changes here might be useful to you.
V6 Authorization and API changes afoot - OpenEMR Development - OpenEMR Community (open-emr.org)
Thanks,
-Rachel