Forum Discussion
Unauthorized response getting reports through groups endpoint of API
- 8 years ago
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!
Is the groupid correct? Can you send the accesstoken in your case to me through a private message?
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!