Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi guys,
Can't find much about PowerBI and Socialbakers here. Socialbakers was unable to help me on their support.
I'm trying to call their API. I tried many ways and today I started to update a code I found here:
let
data = [ date_start= "2019-01-01",
date_end= "2019-12-01",
profiles= {"01234567890"},
metrics= {"fans_lifetime"}],
header = [ #"Authorization"="Basic TWpBek9UYzFYekddddjahsdfkaskjdfhksahdfkajsfd",
#"Content-Type"= "application/json"],
response = Json.Document(Web.Contents("https://api.socialbakers.com/1/facebook/metrics", [Content=Json.FromValue(data)])),
out = Json.Document(response,1252)
in
out
but I get the error:
Any suggestions?
Thanks!
Even I am facing auntentiaon issue. Its not allowing to load Powerquery
Hello
Here is what works for me (connection anonymous). Note that I have used parameters (&...&). When you post on Power BI service, you will need to add to Gateway the data source and do connect anonymous for it to refresh automatically. Hope this helps.
let
url = "https://api.socialbakers.com/1/facebook/metrics",
body = "{ ""date_start"": "&date_start&", ""date_end"": "&date_end&", ""profiles"": ["&facebook&"], ""metrics"": [""fans_lifetime""]}",
Parsed_JSON = Json.Document(body),
BuildQueryString = Uri.BuildQueryString(Parsed_JSON),
Source = Json.Document(Web.Contents(url,
[Headers=[#"Content-Type"="application/json; charset=utf-8",
Authorization="Basic "&key&""],
Content = Text.ToBinary(body)])),
profiles = Source[profiles],
#"Converted to Table" = Table.FromList(profiles, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "data"}, {"Column1.id", "Column1.data"}),
#"Expanded Column1.data" = Table.ExpandListColumn(#"Expanded Column1", "Column1.data"),
#"Expanded Column1.data1" = Table.ExpandRecordColumn(#"Expanded Column1.data", "Column1.data", {"date", "fans_lifetime"}, {"Column1.data.date", "Column1.data.fans_lifetime"})
in
#"Expanded Column1.data1"
error:
Hi @efilipe ,
Based on the error message, it is caused by your authentication. Please clear out the permission and re-connect again.
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
What Social Backes wants:
User | Count |
---|---|
84 | |
80 | |
69 | |
46 | |
46 |
User | Count |
---|---|
106 | |
45 | |
42 | |
39 | |
39 |