Forum Discussion
Connect API with Header ApiKeyName not going through
- 8 years ago
Perhaps this might work too:
Hi jasonfordx,
From the error message, it points that the provided credential is invalid. You may need to check the API key to make sure it have access to source data and you have typed with correct key.
Regards,
Yuliana Gu
- Michal_cwiok8 years agoResolver II
I am not an expert, but my quick research suggests that the header name should be "X-API-KEY" and its value being API-KEY. Now you have header name "Authorization" and value "X-API-KEY:YOUR_KEY".
Try something like this
let Http_query = Json.Document(Web.Contents("<Your URL>", [Headers= [X-AP-KEY ="<Your API KEY>"] ] )), Data = Http_query{0} in DataLet me know, if it works. I think this is the right direction.
- Michal_cwiok8 years agoResolver II
Perhaps this might work too:
- jasonfordx8 years agoHelper II
A new message because I want to clarify something here. IT WORKED Michal!!!. One thing only, its case sensitive. So for some reason, Ive tried x-api-key and DID WORK instead of X-API-KEY. Thank you God and this community.
Ty Michael.
Have a wonderful week everyone :).
- jasonfordx8 years agoHelper II
Dear Mr. Michal, good morning, how are you?
Tried that too. I mean, I think that you suggested to type in the header field: X-API-KEY. Im saying this because reading your code you typed: X-AP-KEY. I ve tried the first one.
EDIT: got the same result using your 2nd suggestion.
Look what I got:
- Markus27814 years agoNew Member
Perfect, thank you!
- jasonfordx8 years agoHelper II
Dear Ms. Gu, good morning, how are you?
My private API key works using curl for Windows. This is why I am comfortable telling you that the private key is working and valid. But I had the same question before. I was trying to reach their data using Excel for the first time and not being able to access. So I was like: Problably I need to talk with them because may be my key. But using Curl worked, so I was like, .... may be a synthax problem hehehehe.
Ty for your time and support.