You have put the api key inside username it should be inside password.
For basic Auth, the username typically be either you client key and password be the *client_secret.
but depending on provider it change. like if you have a client key & Client_secreat
then the username be client_key & password beclient_secreate .
but if you only have api key , and the authorization type supported by provider Basic auth. then username be Authorization & password beapi_key .?
if you still stuck, ping me on linkedin, and i will walk you through it, free of charge