question

MohammedSalim-6908 avatar image
0 Votes"
MohammedSalim-6908 asked ShivaniRai-MSFT-7217 answered

Bad Request - 400 when running getEmailActivityUserCounts

I get a Bad Request - 400 when running this request in Graph Explorer. I have already provided consent for this query against my tenant. Any idea why it might be happening? There are no error details that I can see on the UI in Graph Explorer. Running the example codes provided on the left side panel seems to give me results without issues. I have reported this on GitHub and they closed my issue and asked me to ask here on Q&A:

GET https://graph.microsoft.com/v1.0/reports/getEmailActivityUserCounts(period='D7')


This was generated on GitHub after posting the issue, not sure if it is relevant at all:

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 7ba5abfa-9ba9-2b55-702e-a6553243a445
Version Independent ID: ca831211-3ab4-ac39-70e4-9d00459fddf2
Content: reportRoot: getEmailActivityUserCounts - Microsoft Graph v1.0
Content Source: api-reference/v1.0/api/reportroot-getemailactivityusercounts.md
Product: reports
Technology: microsoft-graph
GitHub Login: @sarahwxy
Microsoft Alias: MSGraphDocsVteam

microsoft-graph-data-connectmicrosoft-graph-insights
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ShivaniRai-MSFT-7217 avatar image
0 Votes"
ShivaniRai-MSFT-7217 answered

Hello @MohammedSalim-6908,

I am able to replicate same issue in Graph Explorer but the API is working fine in Postman as this endpoint returns CSV data that Graph Explorer try to parse as a JSON thus resulting in the error. Graph Explorer does not support CSV data in response as of now.

I have tested this Graph API in Postman and it worked fine. Please refer to below screenshot:
201419-image.png

Similar Post: https://docs.microsoft.com/en-us/answers/questions/306430/why-no-response-to-graph-api-reports-query.html

Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


image.png (55.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.