Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I am working on Web Api dataset Scheduled Refresh with Chris Webb's blogs as guidance. In one of his blogs, he has suggested to use Relative Path and Query options to achieve the desired goal. I am using following code to import the data in JSON Format.
=let
Contents = "{ ""recordsAfterDateTime"": ""2020-11-30T00:00:00"",
""recordsBeforeDateTime"": ""2020-12-24T23:59:59.999"" }",
Source = Json.Document(Web.Contents("https://api.trulinks.co.uk",[RelativePath = "analysis-reports/v1/api/driver-d14",Query = [q="date"]],
[Headers=[#"TT-Api-Key"="abcd", #"Ocp-Apim-Subscription-Key"="abcd",#"Content-Type" = "text/json"],Content = Text.ToBinary(Contents)]))
in
Source
But, i am getting this error: 3 arguments were passed to a function which expects between 1 and 2.
I am a noob in M language so help needed to sort out this issue. Thanks!
Solved! Go to Solution.
let
Contents = "{ ""recordsAfterDateTime"": ""2020-11-30T00:00:00"",""recordsBeforeDateTime"": ""2020-12-24T23:59:59.999"" }",
Source = Json.Document(Web.Contents("https://api.trulinks.co.uk",[
RelativePath = "analysis-reports/v1/api/driver-d14",
Query = [q="date"],
Headers=["TT-Api-Key"="abcd", "Ocp-Apim-Subscription-Key"="abcd","Content-Type" = "text/json"],
Content = Text.ToBinary(Contents)
]
))
in
Source
let
Contents = "{ ""recordsAfterDateTime"": ""2020-11-30T00:00:00"",""recordsBeforeDateTime"": ""2020-12-24T23:59:59.999"" }",
Source = Json.Document(Web.Contents("https://api.trulinks.co.uk",[
RelativePath = "analysis-reports/v1/api/driver-d14",
Query = [q="date"],
Headers=["TT-Api-Key"="abcd", "Ocp-Apim-Subscription-Key"="abcd","Content-Type" = "text/json"],
Content = Text.ToBinary(Contents)
]
))
in
Source
Web.Contents(url as text, optional options as nullable record) as binary
You provided multiple records. All your options need to be enumerated in the same record.
@lbendlin It is returning an error : "Token RightBracket Expected". Can you please show me how to code it according to my query in the question? I would highly appreciate that. Thanks!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 104 | |
| 81 | |
| 66 | |
| 50 | |
| 45 |