Forum Discussion
pangelino
8 years agoRegular Visitor
Unauthorized response getting reports through groups endpoint of API
I'm using the Power API REST API to first retrieve groups that the logged in user has access to, and then to retrieve reports within those groups. I can successfully retrieve reports through the htt...
pangelino
8 years agoRegular Visitor
Eric_ZhangI'm still stuck on this. Would you recommend that I open a ticket with technical support on this?
Eric_Zhang
8 years agoMicrosoft Employee
Is the groupid correct? Can you send the accesstoken in your case to me through a private message?
- pangelino8 years agoRegular Visitor
Eric, in preparing to reply to you I finally discovered the problem. In my C# code I was sending the HTTP request like this:
HttpWebRequest request = CreatePowerBiApiRequest("groups/{groupId}/reports", accessToken);What I realized today is that I forgot the $ at the beginning of the string so that the string interpolation would occur. It should have been like this:
HttpWebRequest request = CreatePowerBiApiRequest($"groups/{groupId}/reports", accessToken);So the request was just statically sending the string "{groupId}" in the request instead of substituting in the actual group ID value. Totally my bad! :smileyembarrassed:
Thanks for your help!