SCRAM-SHA-1: (AtlasError) bad auth : Authentication failed while using mongodb api

Hey @everyone
I am trying to make crud api request using mongodb Data API. I am trying to make requests to my database to get data from the collections. I have whitelisted my IP and have added IP for connecting from anywhere. I have also added the API key to the request and in the body i am passing the
{ "dataSource": "Cluster0", "database" : "myFirstDatabase", "collection" : "phonelogsdetails" }
Any idea on why this autnentication error is coming and how to remove it

It says bad authentication
Are you using correct userid/pwd?
Can you connect by shell?
Does your password has any special characters?