Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
I am trying to call external API but this code is giving me "Token Literal Expected". I am trying to send JSON in the body of the HTTP request. Can someone suggest what I am missing here please? I have also tried to use only one quote but that didn't work either.
let
SvcUrl = "https://APIURL",
ApiKey = "myAPIKEY",
Content = "
{
""name"": ""someName"",
""metrics"": [
{
""metricId"": ""Calls"",
""aggregator"": ""count"",
""name"": ""calls_count""
}
],
""groupBy"": [
{
""attributeId"": ""CallRequestedTime"",
""timeDisplayType"": ""day:"",
""name"": ""callrequestedtime_day""
}
],
""filters"": [
{
""attributeId"": ""CallAgent""
}
],
""timeZone"": ""EasternStandard Time""
}"
,
Response= Web.Contents(SvcUrl,
[
Content=Text.ToBinary(Content),
Headers=[ApiKey=ApiKey, #"Content-Type" = "application/json"]
]
),
Json = Json.Document(Response)
in
Check example 2 for an alternative way to submit the request body.
That worked for me. I must have missed that page. Thank you
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 7 | |
| 4 | |
| 4 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 12 | |
| 11 | |
| 11 | |
| 7 | |
| 6 |