"errors": "[API] Invalid API key or access token (unrecognized login or wrong password)"

I am facing the following error

“errors”: “[API] Invalid API key or access token (unrecognized login or wrong password)” when I try to access my app using basic authentication method. I am using the following url
https://{username}:{password}@{shop}.myshopify.com/admin/api/2022-01/{resource}.json

where username is API key
password is API secret key from the app page.

Can anyone please help me resolve this issue

add.

$headers = [
‘Content-Type: application/json’,
'X-Shopify-Access-Token: ’ . $token,
];