How can I check Office 365 cost or usage data for EA subscriptions using Rest API?

Anonymous
2023-04-27T02:13:02.79+00:00

Hi.

Currently, the office 365 data of CSP, Azure plan subscriptions can be viewed through the invoice API below.

https://learn.microsoft.com/en-us/partner-center/developer/get-invoiceline-items#rest-request

What API should I use to view office 365 cost or billing data for EA accounts and subscriptions?

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
3,607 questions
Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Install, redeem, activate | For business | Windows
{count} votes

Accepted answer
  1. SadiqhAhmed-MSFT 49,331 Reputation points Microsoft Employee Moderator
    2023-04-27T14:23:08.4766667+00:00

    Hello @Sunyoup Park (박선엽) Thank you for contacting us on Microsoft Q&A platform. Happy to help!

    To check Office 365 cost or usage data for EA subscriptions using the Rest API, you can use the Microsoft Graph API. Here are the steps to do that:

    1. Register your application in Azure Active Directory and obtain an access token for the Microsoft Graph API.
    2. Use the following endpoint to get the usage data for an EA subscription: https://graph.microsoft.com/v1.0/reports/getOffice365ActivationsUserDetail(period='{period}')
    • Replace {period} with the desired time period for the report. For example, D7 for the last 7 days, D30 for the last 30 days, or D90 for the last 90 days.
    1. Use the following endpoint to get the cost data for an EA subscription: https://graph.microsoft.com/v1.0/reports/getOffice365ActiveUserCounts(period='{period}')
    • Replace {period} with the desired time period for the report. For example, D7 for the last 7 days, D30 for the last 30 days, or D90 for the last 90 days.

    You can also use the Microsoft Graph API to get other types of usage and cost data for Office 365, such as email activity, OneDrive usage, and SharePoint usage.

    I hope this helps! Feel free to reply if you have any further questions.


    If the response helped, do "Accept Answer" and up-vote it


1 additional answer

Sort by: Most helpful
  1. Saad Markou 11 Reputation points
    2023-04-27T14:37:40.9+00:00

    To view Office 365 cost or billing data for EA (Enterprise Agreement) accounts and subscriptions, you can use the Azure Billing API. This API provides a programmatic way to access your billing and usage data for Azure services, as well as for other Microsoft services such as Office 365.

    Here are the general steps you can follow to use the Azure Billing API:

    1. Create an Azure billing account: If you haven't already, create an Azure billing account in your Azure subscription.
    2. Create an Azure AD application: Create an Azure AD application to authenticate your requests to the Azure Billing API.
    3. Grant permissions: Grant your Azure AD application the necessary permissions to access your billing data through the Azure Billing API.
    4. Obtain an access token: Obtain an access token using your Azure AD application's client ID and secret.
    5. Make API calls: Use the Azure Billing API to make calls to retrieve billing data, such as usage and charges for Office 365 services.

    You can find detailed information about how to use the Azure Billing API to access your billing data in the Azure documentation, including examples of API requests and responses.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.