Hi Yong - I agree with Suresh's response that you'll want to also engage with your TAM if there is one on your account as troubleshooting like this may require some back & forth with a person that has access to your organization's account.
One pointer I can give, as a TAM myself, is to look at the format of the API Key that you're using. When passing the API Key through as a header, you'll want to make sure that the API Key has been base64 encoded. However, if you're passing it through like a USERNAME by using the "-u" with your cURL, you'll want to use the raw API Key as it shows in Cloudability. I'll give examples below to illustrate.
Before we get to the Example cURL, here's some things to consider in how I'm building it :
- URL = https://api.cloudability.com/v3/vendors
- "RAW" Cloudability API Key (as it appears in Cloudability) : 123456789ABCDEFG
- "Base64 Encoded" Cloudability API Key : MTIzNDU2Nzg5QUJDREVGRzo=
Example cURL :
curl --location --request GET 'https://api.cloudability.com/v3/vendors' \
--header 'Authorization: Basic MTIzNDU2Nzg5QUJDREVGRzo='
If you're wanting to pass it using a cURL specifically using the "-u" instead of "--header", it will need to look something like this :
curl 'https://api.cloudability.com/v3/vendors' -u '123456789ABCDEFG:'
Note that in the second example, there is a colon (:) after the encoded API Key, and I'm using the RAW API Key. This is because the cURL being written in that format (a key:value pair) is designed to pass a username and a password together. The API Key works as a username in this context, and there's no password, so that's why there isn't anything after the colon.
In the first example, because it's being passed as a header using BASIC Auth, the API Key must be base64 encoded, and there's no need for the colon because a password is not expected in this format of API call.
Just to be certain I had everything formatted properly before posting this response, I did try both of the above cURLs (using real API Keys instead of the fake ones I used above), and it did result in the desired response. My guess is that you may have either been trying to use the Cloudability API Key without a colon (for the -u method) or forgetting to encode it into base64 (for the header method).
#Cloudability