Forum Discussion
A web API key can only be specified when a web API key name is provided.
Hi Folks,
I am using REST API to fetch the data from 3rd party using POST method, I have used the same parameters in Header, Body in postman, and it is giving me the data in JSON format, but when I am using the same thing in power query, it is giving me an error: Response Msg: Invalid APi credentials
Response code:11
response : NULL
Please have a look in my power query below and help me what is wrong in this :-
let
ApiOwner= "XXXXXXXX",
ApiKey="XXXXXXXXXXXXXXXXXXXXXXXXX",
url = "https://dentalkart.vineretail.com/RestWS/api/eretail/v3/sku/inventoryStatus",
header= [#"Authorization" = ApiKey & ApiOwner,
#"Content-Type" = "application/x-www-form-urlencoded"],
RequestBody=
"{
""skuCodes"":""[]"",
""fromDate"":""18/06/2021 15:40:30"",
""toDate"":""23/06/2021 15:40:30"",
""pageNumber"":""1"",
""dropShipFlag"":""no"",
""locCode"":""
}",
webdata = Web.Contents(url, [Content = Text.ToBinary(RequestBody), Headers=header]),
response = Json.Document(webdata)
in
response
Any kind of help would really be appreciated !
- ImkeF5 years agoCommunity Champion
Hi akashgera ,
hard to tell without seeing the official API documentation.
What I find a bit surprising is that API Key and API owner are concatenated into one string without any separator or other structure. Is this really correct?- akashgera5 years agoHelper I
ImkeF Thanks for the response, please find below the web link of official API docs
I am not sure about the API Key and API owner whether it should be concatenated it or not, what I found on API docs, I have done the same thing, Also postman is giving me the data in response when I am passing all the parameters, For your reference I am attaching few screenshots from my system.
From Postman:
Please help !