Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi All,
I am trying to perform this API Request from the Pendo Documentation
curl --location --request POST 'https://app.pendo.io/api/v1/aggregation' \
--header 'X-Pendo-Integration-Key: <PENDO_INTEGRATION_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"response": {
"mimeType": "application/json"
},
"request": {
"name": "responseCount",
"pipeline": [{
"source": {
"pollsSeen": {
"guideId": "{guideId}",
"pollId": "{pollId}"
},
"timeSeries": {
"period": "dayRange",
"first": "now()",
"count": -30
}
}
}, {
"identified": "visitorId"
}, {
"reduce": [{
"count": {
"count": "visitorId"
}
}]
}],
"requestId": "responseCount"
}
}'
I am able to get to the guide I want with the following in Power Query, but am unsure how to add the information from "data-raw" to get the list of reponses. Any help is appreciated.
let
Source = Json.Document(
Web.Contents(
"https://app.pendo.io/api/v1/guide?id=zHMFRgLR-oQgZwdTTmuXzU1qV08",
[Headers=[#"content-type"="application/json",
#"x-pendo-integration-key"="XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"]]
)
)
in
Source
Solved! Go to Solution.
Hi @Anonymous
-d is for the body content of a POST request. You can add the content to the Content property of Web.Contents() function. Web.Contents - PowerQuery M | Microsoft Learn
Content
: Specifying this value changes the web request from a GET to a POST, using the value of the option as the content of the POST.
You may try
let
body = "{
""response"": {
""mimeType"": ""application/json""
},
""request"": {
""name"": ""responseCount"",
""pipeline"": [{
""source"": {
""pollsSeen"": {
""guideId"": ""{guideId}"",
""pollId"": ""{pollId}""
},
""timeSeries"": {
""period"": ""dayRange"",
""first"": ""now()"",
""count"": -30
}
}
}, {
""identified"": ""visitorId""
}, {
""reduce"": [{
""count"": {
""count"": ""visitorId""
}
}]
}],
""requestId"": ""responseCount""
}
}"",
Source = Json.Document(
Web.Contents(
"https://app.pendo.io/api/v1/guide?id=zHMFRgLR-oQgZwdTTmuXzU1qV08",
[Content=Text.ToBinary(body), Headers=[#"content-type"="application/json",
#"x-pendo-integration-key"="XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"]]
)
)
in
Source
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi @Anonymous
-d is for the body content of a POST request. You can add the content to the Content property of Web.Contents() function. Web.Contents - PowerQuery M | Microsoft Learn
Content
: Specifying this value changes the web request from a GET to a POST, using the value of the option as the content of the POST.
You may try
let
body = "{
""response"": {
""mimeType"": ""application/json""
},
""request"": {
""name"": ""responseCount"",
""pipeline"": [{
""source"": {
""pollsSeen"": {
""guideId"": ""{guideId}"",
""pollId"": ""{pollId}""
},
""timeSeries"": {
""period"": ""dayRange"",
""first"": ""now()"",
""count"": -30
}
}
}, {
""identified"": ""visitorId""
}, {
""reduce"": [{
""count"": {
""count"": ""visitorId""
}
}]
}],
""requestId"": ""responseCount""
}
}"",
Source = Json.Document(
Web.Contents(
"https://app.pendo.io/api/v1/guide?id=zHMFRgLR-oQgZwdTTmuXzU1qV08",
[Content=Text.ToBinary(body), Headers=[#"content-type"="application/json",
#"x-pendo-integration-key"="XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"]]
)
)
in
Source
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
101 | |
45 | |
19 | |
13 | |
11 |