Forum Discussion
Power BI Desktop - Connect to UserVoice
Hi taniagobeil,
Based on my research, you can consider use web data source in desktop to get data from the UserVoice. See: How to call REST APIs and parse JSON with Power BI.
Best Regards,
Qiuyun Yu
Hi v-qiuyu-msft
I followed the steps in your link and it works like a charm. However, it only works for unauthenticated requests. I want to access User statisfaction responses (/api/v1/reports/user_satisfaction_responses.json) and that requires oAuth authentication. Do you know if there is a way to do this in PowerBI?
Thanks for the help!
Tania
- v-qiuyu-msft9 years agoCommunity Support
Hi taniagobeil,
I think you need to know how to call UserVoice use oAuth authentication firstly. See: UserVoice OAuth Reference.
Best Regards,
Qiuyun Yu- taniagobeil9 years agoRegular Visitor
IndeedĀ. I've been looking all over for examples on how to use the UserVoice API.
I found this great post from Steve Howard on API Strategies with Power BI (http://angryanalyticsblog.azurewebsites.net/index.php/2016/05/16/api-strategies-with-power-bi/). There is an example on connecting Power BI to the Twitter API using OAuth. I followed the steps and I managed to get the Twitter data easily.
I modified the example script to work with User Voice but I always get an error message "The user was not authorized". I am using anonymous authentication. I feel like I am 2 inches away from the solution, but I just can't seem to get it working!
Here is the script I am using:
// Source: http://angryanalyticsblog.azurewebsites.net/index.php/2016/05/16/api-strategies-with-power-bi/
let
// Concatenates the Consumer Key & Consumer Secret and converts to base64
authKey = "Basic " & Binary.ToText(Text.ToBinary(#"UserVoice API Key" & ":" & #"UserVoice API Secret"),0),
url = "https://MYSUBDOMAINHERE.uservoice.com/oauth/request_token",// Uses the oauth2/token method to obtain a bearer token
GetJson = Web.Contents(url,
[
Headers = [#"Authorization"=authKey,
#"Content-Type"="application/x-www-form-urlencoded;charset=UTF-8"],
Content = Text.ToBinary("grant_type=client_credentials")
]
),
FormatAsJson = Json.Document(GetJson),// Gets token from the Json response
AccessToken = FormatAsJson[access_token],
AccessTokenHeader = "bearer " & AccessToken,// Uses the method using the bearer token from the previous POST oauth2/token method
GetJsonQuery = Web.Contents("https://MYSUBDOMAINHERE.uservoice.com/api/v1/reports/user_satisfaction_responses.json",
[
Headers = [#"Authorization"=AccessTokenHeader]
]
),
FormatAsJsonQuery = Json.Document(GetJsonQuery)
in
#"FormatAsJsonQuery"Any ideas?
- Anonymous7 years agoNot applicable
Hi @taniagobeil,
Did you ever get this working? I am trying to connect our UserVoice account to Power BI and am having similar issues. Unfortunately the UserVoice Data Connector within the data sources list does not work with custom domains using oAuth. Any ideas?