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
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 :).
- Michal_cwiok8 years agoResolver II
jasonfordxThis is great! Thank you clarifying that it is case sensitive!
Would it be possible for you to paste the M/Power Query code from advanced editor? This would be helpful for solving future problems. Thanks!
- 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!