Error while performing the infinity query. unsuccessful HTTP response code status code : 401 Unauthorized

Hi, can someone help me with grafana integration with my company API!
I tested the Apikey and the test went successful. However, while creating a dashboard, I could not see any data as it replies with an error

“error while performing the infinity query. unsuccessful HTTP response code status code : 401 Unauthorized
(Trace ID: b906fb28715e98fced264a354d8c7166)”.

I am very new to Grafana, so your help means a lot to me. Thanks.