Bad Request - 400 when running getEmailActivityUserCounts

Mohammed Salim 6 Reputation points
2022-05-12T08:22:05.34+00:00

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 learn.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
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,588 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ShivaniRai-MSFT 2,726 Reputation points
    2022-05-12T11:05:24.977+00:00

    Hello @Mohammed Salim ,

    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://learn.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.

    0 comments No comments