Forum Discussion

karl184's avatar
karl184
Frequent Visitor
3 years ago

Post Api Call in Power Qwery

Hello All ,

I need to get data from this web call :

the blank space are names of company .

The Headers are :

#"Accept" = "application/json",
#"connector-name" = "sql",
#"Content-Type" = "application/json"

 

The Body :

{ "parameters": [ { "LIMIT": "55" }, { "OFFSET": "0" } ] }

 

Furthermore I have an Authorization Key .

I wrote this in advance editor :

let

Key = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",

URL = "",

headers=
[
#"Authorization" = Key,
#"Accept" = "application/json",
#"connector-name" = "sql",
#"Content-Type" = "application/json"
],

Body=
"{""parameters"": [{""LIMIT"": ""55""},{""OFFSET"": ""0""}]}",

source = Json.Document(Web.Contents(URL, [Headers = headers,Content = Text.ToBinary(Body)]))

in
source

 

But it doesnt work : "name could not be resolved" 

 

 

Whereas when I test this api call online works :

Body :

 

Key :

 

Headers :

 

Works :

 

Could someone help me ? 

Thank you 

 

2 Replies

  • karl184's avatar
    karl184
    Frequent Visitor

    I tried as well in Postman :

    In Api Key Value I pasted the key .

    Here the headers :

    Then the body :

     

    When I send the call is working :

    Could someone help me ? 

    Thank you