Forum Discussion

pangelino's avatar
pangelino
Regular Visitor
8 years ago
Solved

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's avatar
    pangelino
    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!