Get License Consumption Report
    • 16 Jul 2023
    • 2 Minutes to read
    • Dark
      Light
    • PDF

    Get License Consumption Report

    • Dark
      Light
    • PDF

    Article summary

    Get details on license consumption for any CSP Tenant

    URL

    GET https://contoso-prod-api.azurewebsites.net/api/licenseConsumptionReport/customer/{{customerId}}/tenant/{{tenantId}}

    {{customerId}} – This is a mandatory parameter. Pass the C3 customer Id (local customer id generated by C3) to this parameter to get the details of a particular customer.

    {{tenantid}} – This is a mandatory parameter. Pass the Microsoft customer Id to this parameter to get the details of a particular customer.

    Request headers

    Key

    Value

    Authorization

    Bearer <access_token>

    Content-Type

    Application/json

    Request body

    The request doesn’t require any parameters / body

    Response body

    An example response for the request to get active customers is as follows:

    {
    
        "OperationType": null,
    
        "Status": "Success",
    
        "RequestCorrelationID": "da879f7a-732a-4045-84bb-b1777a1ffc3c",
    
        "ErrorMessage": null,
    
        "ErrorDetail": null,
    
        "Data": [
    
            {
    
                "ActiveUnits": 65,
    
                "AvailableUnits": 5,
    
                "TotalUnits": 65,
    
                "ProducName": "Office 365 G1 GCC",
    
                "ProductSkuId": "3f4babde-90ec-47c6-995d-d223749065d1",
    
                "ConsumedUnits": 60,
    
                "SubcriptionNames": " Office 365 G1 GCC(Monthly)"
    
            },
    
            {
    
                "ActiveUnits": 2,
    
                "AvailableUnits": 0,
    
                "TotalUnits": 2,
    
                "ProducName": "Visio Plan 2 for GCC",
    
                "ProductSkuId": "4ae99959-6b0f-43b0-b1ce-68146001bdba",
    
                "ConsumedUnits": 2,
    
                "SubcriptionNames": " Visio Plan 2 for GCC(Monthly)"
    
            },

    Here is the explanation for the properties in the response (JSON) 

    Property

    Description

    OperationType

    Can be ignored

    Status

    Indicates the status of the request. Possible values – Success / Error

    RequestCorrelationID

    Internal ID generated by C3 for correspondence for troubleshooting issues, if any.

    ErrorMessage

    Message in case the request runs into an error during processing

    ErrorDetail

    Additional detail related to the error in case there is an error while processing the request

    Data

    Contains a list of customer objects represented by the following attributes:

    Attribute

    Description

    ActiveUnits

    license count of total purchased units through your Partner Center

    AvaiableUnits

    count for unassigned units

    Totalunits

    license count of total purchased units in customer’s tenant (across all authorized CSP for them)

    Productname

    name of purchased offer

    ProductSkuId

    SKU ID of the offer

    ConsumedUnits

    count of assigned units

    SubcriptionNames

    Name of the offers with billing cycle frequency


    Error response

    The API validates the input parameters – customer id and the tenant Ids and returns 400 – Bad request error in case the input is found to be invalid.

    A sample bad request error covering both the attributes is as follows:

    {
    
        "OperationType": null,
    
        "Status": "Error",
    
        "RequestCorrelationID": "e002cf54-bbaf-4838-8a66-f016c70c907a",
    
        "ErrorMessage": "ERROR_DESC_BAD_INPUT",
    
        "ErrorDetail": "ERROR_DESC_BAD_INPUT",
    
        "Data": [
    
            {
    
                "Atribute": "CustomerId",
    
                "AtributeKey": "CUSTOMER_C3ID",
    
                "Message": "INVALID_C3_CUSTOMER_ID",
    
                "DefaultMessage": "Invalid c3 Customer ID",
    
                "Value": "9582D9F2-1234945-AB56-DADED948C1C4"
    
            },
    
            {
    
                "Atribute": "TenantId",
    
                "AtributeKey": "TENANT_ID",
    
                "Message": "INVALID_TENANT_ID",
    
                "DefaultMessage": "Invalid tenant ID",
    
                "Value": "0f96f6b1-fe7f-4322-567-152d0f2ff171"
    
            }
    
        ]

    Property

    Description

    OperationType

    Can be ignored

    Status

    Indicates the status of the request. Possible values – Success / Error

    RequestCorrelationID

    Internal ID generated by C3 for correspondence for troubleshooting issues, if any.

    ErrorMessage

    Message in case the request runs into an error during processing

    ErrorDetail

    Additional detail related to the error in case there is an error while processing the request

    Data

    Contains a list of validation errors represented by the following attributes:

    • Attribute – The input in the request that is invalid
    • AttributeKey – This is for internal purposes ( only used if we were to present custom labels to the user )
    • Message –Reason for the validation failure
    • DefaultMessage – error message in English
    • Value – input

    Was this article helpful?