Forum Discussion

luca_morelli's avatar
luca_morelli
Copper Contributor
Sep 24, 2020

unable to download reports using graph sdk

Hi,

  I'm trying to download the reports using 

 

return await graphClient.Reports.GetTeamsUserActivityCounts("D90")
.Request(/*queryOptions*/).GetAsync();

  but when I invoke it I obtain this error message

JsonReaderException: Unexpected character encountered while parsing value: R. Path '', line 0, position 0.

 

This api does a redirect and send a cvs file, but looks like the sdk Is trying to parse it as a Json file. How can I do?

 

3 Replies

  • luca_morelli , What query parameters you are passing in the request?

    Can you try below piece of code to get userCount report

     

    GraphServiceClient graphClient = new GraphServiceClient( authProvider );

    var report = await graphClient.Reports
        .GetTeamsUserActivityCounts("D90")
        .Request()
        .GetAsync();
      • Trinetra-MSFT's avatar
        Trinetra-MSFT
        Former Employee

        luca_morelli ,   I tried the same in graph explorer, and was able to get the response correctly without any error. Could you please tell what query parameter you are passing in Request?