UserUsageReport: get

Requires authorization

Retrieves a report which is a collection of properties and statistics for a set of account users. For more information, see the Developer's Guide.

Try it now.

Request

HTTP request

GET https://www.googleapis.com/admin/reports/v1/usage/users/userKey or all/dates/date

Parameters

Parameter name Value Description
Required parameters
date string Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We recommend you use your account's time zone for this.
userKey or all string The value can be:
  • all – Returns all of the account's user information.
  • userKey – Represents either the primary email address of the user or entity making the change, or the user's profile ID. A user's profileId is returned in the API response.
Optional parameters
customerId string The unique ID of the customer to retrieve data for.
filters string The filters query string is a comma-separated list of an application's event parameters where the parameter's value is manipulated by a relational operator. The filters query string includes the name of the application whose usage is returned in the report. The application values for the Users usage report include accounts, docs, and gmail.
Filters are in the form [application name]:[paramter name][relational operator][parameter value],....
In this example, the <> 'not equal to' operator is URL-encoded in the request's query string (%3C%3E):
GET https://www.googleapis.com/admin/reports/v1/usage/users/all/dates/2013-03-03
?parameters=accounts:last_login_time
&filters=accounts:last_login_time>2010-10-28T10:26:35.000Z

The relational operators include:

  • == – 'equal to'.
  • <> – 'not equal to'. It is URL-encoded (%3C%3E).
  • < – 'less than'. It is URL-encoded (%3C).
  • <= – 'less than or equal to'. It is URL-encoded (%3C=).
  • > – 'greater than'. It is URL-encoded (%3E).
  • >= – 'greater than or equal to'. It is URL-encoded (%3E=).

maxResults unsigned integer Determines how many activity records are shown on each response page. For example, if the request sets maxResults=1 and the report has two activities, the report has two pages. The response's nextPageToken property has the token to the second page.
The maxResults query string is optional. The minimum maxResults value is 1, and the maximum value is 1000 and 1000 is the default value.
orgUnitID string ID of the organizational unit to report on. User activity will be shown only for users who belong to the specified organizational unit.
pageToken string Token to specify next page. A report with multiple pages has a nextPageToken property in the response. In your follow-on request getting the next page of the report, enter the nextPageToken value in the pageToken query string.
parameters string The parameters query string is a comma-separated list of event parameters that refine a report's results. The parameter is associated with a specific application. The application values for the Users usage report include accounts, docs, and gmail.
A parameter query string is in the CSV form of [app_name1:param_name1], [app_name2:param_name2]....
Note: The API does not accept multiple values of a parameter. If a particular parameter is supplied more than once in the API request, the API only accepts the last value of that request parameter. In addition, if an invalid request parameter is supplied in the API request, the API ignores that request parameter and returns the response corresponding to the remaining valid request parameters. An example of an invalid request parameter is one that does not belong to the application. If no parameters are requested, all parameters are returned.

Authorization

This request requires authorization with at least one of the following scopes (read more about authentication and authorization).

Scope
https://www.googleapis.com/auth/admin.reports.usage.readonly

Request body

Do not supply a request body with this method.

Response

If successful, this method returns a response body with the following structure:

{
  "kind": "reports#usageReports",
  "warnings": [
    {
      "code": string,
      "message": string,
      "data": [
        {
          "key": string,
          "value": string
        }
      ]
    }
  ],
  "nextPageToken": string,
  "usageReports": [
    {
      "kind": "usageReport",
      "date": string,
      "entity": {
        "type": string,
        "customerId": string,
        "userEmail": string,
        "profileId": long
      },
      "parameters": [
        {
          "name": string,
          "name": string,
          "name": string,
          "stringValue": string,
          "datetimeValue": datetime,
          "intValue": long,
          "boolValue": boolean
        }
      ]
    }
  ]
}
Property name Value Description Notes
kind string The type of API resource. For a usage report, the value is reports#usageReports.
warnings[] list Warnings if any.
warnings[].code string Machine readable code or warning type. The code value is 200
warnings[].message string The human readable messages for a warning are:
  • Data is not available warning – Sorry, data for date yyyy-mm-dd for application application name is not available.
  • Partial data is available warning – Data for date yyyy-mm-dd for application application name is not available right now, please try again after a few hours.
warnings[].data[] list Key-Value pairs to give detailed information on the warning.
warnings[].data[].key string Key associated with a key-value pair to give detailed information on the warning.
warnings[].data[].value string Value associated with a key-value pair to give detailed information on the warning.
nextPageToken string A report with multiple pages has a nextPageToken property in the response. In your follow-on request getting the next page of the report, enter the nextPageToken value in the pageToken query string.
usageReports[] list Various application parameter records.
usageReports[].kind string The type of API resource. For a usage report, the value is usageReport.
usageReports[].date string The date of the report request.
usageReports[].entity object Information about the type of the item.
usageReports[].entity.type string The type of item which has the value user.
usageReports[].entity.customerId string The unique identifier of the account.
usageReports[].entity.userEmail string The primary email address of the user or entity making the change to the account, or causes a change to happen.
usageReports[].entity.profileId long The user's immutable G Suite profile identifier.
usageReports[].parameters[] list Parameter value pairs for various applications. For the Users usage report parameters and values, see the user's usage parameters reference.
usageReports[].parameters[].name string The name of the parameter. For the Users usage report parameters and values, see the user's usage parameters reference.
usageReports[].parameters[].stringValue string String value of the parameter.
usageReports[].parameters[].datetimeValue datetime The RFC 3339 formatted value of the parameter, for example 2010-10-28T10:26:35.000Z.
usageReports[].parameters[].intValue long Integer value of the parameter.
usageReports[].parameters[].boolValue boolean Boolean value of the parameter.

Try it!

Use the APIs Explorer below to call this method on live data and see the response.

Send feedback about...

Reports API
Reports API
Need help? Visit our support page.