Forum Discussion
Vankod
9 years agoFrequent Visitor
How to add body into Web.Contents()?
I need to add Body {
"method": "get",
"params": {
"SelectionCriteria": {},
"FieldNames": ["Id", "Name"]
}
} in Web.Contents() query. I can not understand how to do it. Is ...
- 9 years ago
Done!
Solution from here: https://eriksvensen.wordpress.com/2014/09/15/specifying-json-query-in-power-query-example-statistics-sweden/
let content = "{ ""method"": ""get"", ""params"": { ""SelectionCriteria"": {}, ""FieldNames"": [""Id"", ""Name""] } }", Source = Json.Document(Web.Contents("https://api-sandbox.direct.yandex.com/json/v5/campaigns", [Headers=[Authorization="Bearer AQAAAAANlKwBAAQQn4Wfgbxxxxxxxxxx"], Content=Text.ToBinary(content)])) in Source
Vankod
9 years agoFrequent Visitor
Thanks, Anonymous!
It's return JSON body content. This is useful step
But how to use it in Web.Contents() query?
Vankod
9 years agoFrequent Visitor
Done!
Solution from here: https://eriksvensen.wordpress.com/2014/09/15/specifying-json-query-in-power-query-example-statistics-sweden/
let
content = "{
""method"": ""get"",
""params"": {
""SelectionCriteria"": {},
""FieldNames"": [""Id"", ""Name""]
}
}",
Source = Json.Document(Web.Contents("https://api-sandbox.direct.yandex.com/json/v5/campaigns", [Headers=[Authorization="Bearer AQAAAAANlKwBAAQQn4Wfgbxxxxxxxxxx"], Content=Text.ToBinary(content)]))
in
Source- Anonymous9 years agoNot applicable
VankodLovely, had wasted lot of time in trying to fect something, your reply helped me resolve it :)