Forum Discussion
Access to Medallia with APIs
Hi gdecome ,
To be honest, I have no experience of that.
Maybe You can come up a new idea and add your comments there to make this feature coming sooner.
https://ideas.powerbi.com/forums/265200-power-bi-ideas
- gdecome6 years agoHelper III
Thank you ... in fact a connector would be good, but the API works. Just trying to find someone who could give some tips on how to use them.
- Anonymous6 years agoNot applicable
Hi gdecome did you find a solution for this issue?
I'm also trying to connect Medallia to Power BI. In the absence of a connector, a connection via API could be a solution like you said.
- gdecome6 years agoHelper III
Hi Anonymous, API is working fine. See the example below. You can find more information about what to use in sqlQuery in Medallia documentation for API
1) Create a function in Power Query (e.g. fnGetData)
let
GetData = (sqlQuery) =>
let
authURL = "https://XXXXX.medallia.com/oauth/XXXXX/token",
body = "grant_type=client_credentials&scope=-d&client_id=XXXXX&client_secret=XXXXX",
// Get Token ----------------------------------
getToken = Json.Document(
Web.Contents(
authURL,
[
Headers=[#"Content-Type"="application/x-www-form-urlencoded"],
Content=Text.ToBinary(body)
]
)
),
token = getToken[access_token],
// Get Data ------------------------------------
urlRequest = "https://XXXXX.apis.medallia.com/data/v0/mql",
rawData = Csv.Document(
Web.Contents(
urlRequest,
[
Headers=[Authorization="Bearer " & token ],
Query=[company="XXXXX",output="csv",version="1",query=sqlQuery]
]
)
)
in
rawData
in
GetData
Example of Query to use the function above
let
sqlQuery = "SELECT COUNT(*) FROM survey",
Source = fnGetData(sqlQuery),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true])
in
#"Promoted Headers"