unable to download reports using graph sdk

%3CLINGO-SUB%20id%3D%22lingo-sub-1707508%22%20slang%3D%22en-US%22%3Eunable%20to%20download%20reports%20using%20graph%20sdk%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1707508%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%20I'm%20trying%20to%20download%20the%20reports%20using%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3Ereturn%20await%20graphClient.Reports.GetTeamsUserActivityCounts(%22D90%22)%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E.Request(%2F*queryOptions*%2F).GetAsync()%3B%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%20but%20when%20I%20invoke%20it%20I%20obtain%20this%20error%20message%3C%2FP%3E%3CP%3E%3CSTRONG%3EJsonReaderException%3A%20Unexpected%20character%20encountered%20while%20parsing%20value%3A%20R.%20Path%20''%2C%20line%200%2C%20position%200.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20api%20does%20a%20redirect%20and%20send%20a%20cvs%20file%2C%20but%20looks%20like%20the%20sdk%20Is%20trying%20to%20parse%20it%20as%20a%20Json%20file.%20How%20can%20I%20do%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1707508%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1711681%22%20slang%3D%22en-US%22%3ERe%3A%20unable%20to%20download%20reports%20using%20graph%20sdk%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1711681%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F790304%22%20target%3D%22_blank%22%3E%40luca_morelli%3C%2FA%3E%26nbsp%3B%2C%20What%20query%20parameters%20you%20are%20passing%20in%20the%20request%3F%3C%2FP%3E%0A%3CP%3ECan%20you%20try%20below%20piece%20of%20code%20to%20get%20userCount%20report%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%3E%0A%3CDIV%3E%3CSPAN%3EGraphServiceClient%20graphClient%20%3D%20%3C%2FSPAN%3E%3CSPAN%3Enew%3C%2FSPAN%3E%3CSPAN%3E%20GraphServiceClient(%20authProvider%20)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3Evar%3C%2FSPAN%3E%3CSPAN%3E%20report%20%3D%20%3C%2FSPAN%3E%3CSPAN%3Eawait%3C%2FSPAN%3E%3CSPAN%3E%20graphClient.Reports%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B.GetTeamsUserActivityCounts(%3C%2FSPAN%3E%3CSPAN%3E%22D90%22%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B.Request()%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B.GetAsync()%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1728059%22%20slang%3D%22en-US%22%3ERe%3A%20unable%20to%20download%20reports%20using%20graph%20sdk%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1728059%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F371090%22%20target%3D%22_blank%22%3E%40Trinetra-MSFT%3C%2FA%3E%26nbsp%3BI%20used%20the%20same%20code%20with%20that%20result.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1762881%22%20slang%3D%22en-US%22%3ERe%3A%20unable%20to%20download%20reports%20using%20graph%20sdk%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1762881%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F790304%22%20target%3D%22_blank%22%3E%40luca_morelli%3C%2FA%3E%26nbsp%3B%2C%26nbsp%3B%20%26nbsp%3BI%20tried%20the%20same%20in%20graph%20explorer%2C%20and%20was%20able%20to%20get%20the%20response%20correctly%20without%20any%20error.%20Could%20you%20please%20tell%20what%20query%20parameter%20you%20are%20passing%20in%20Request%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

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
Highlighted

@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();
Highlighted

@Trinetra-MSFT I used the same code with that result.

 

Highlighted

@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?