How to use admin, reports_v1 and gapi.client.reports.activities.list to get list of rename actions?

696 views Asked by At

With authentication in place and working, I make the following call to reports.activities.list, but the response I get isn't what I expect and I cannot figure out how to get from it, to the example output listed at: https://developers.google.com/admin-sdk/reports/v1/guides/manage-audit-drive

The call I'm using:

    gapi.client.load('admin', 'reports_v1', function() {

        var request = gapi.client.reports.activities.list({
            userKey: "all",
            applicationName: "drive",
            eventName: "rename",
            maxResults: 1000
        });

        // Step 6: Execute the API request
        request.execute(function(resp) {
            console.log('RESPONSE', resp);
        });
    });

What I get:

{ etag: "RU_ANZvud_qrxRGJHqK2w1PCmE4/0KjFXXAxoKwaGvefoHFTLVbMs2g",
kind: "admin#reports#activities",
result: { etag: "RU_ANZvud_qrxRGJHqK2w1PCmE4/0KjFXXAxoKwaGvefoHFTLVbMs2g",
kind: "admin#reports#activities" } }

What I expect:

{
 "kind": "reports#auditActivities",
 "nextPageToken": "next page's token",
 "items": [
  {
   "kind": "audit#activity",
   "id": {
    "time": "2014-03-17T15:39:18.460Z",
    "uniqQualifier": "report's unique ID",
    "applicationName": "drive",
    "customerId": "ABC123xyz"
   },
   "actor": {
   "callerType": "USER",
   "email": "[email protected]",
   "profileId": "user's unique Google Apps profile ID",
   "key": "consumer key of requestor in an OAuth 2LO request"
   },
   "ownerDomain": "domain of the source owner",
   "ipAddress": "user's IP address",
   "events": [
    {
     "type": "access",
     "name": "edit",
     "parameters": [
      {
        "name": "primary_event",
        "value": "the primary_event value",
        "intValue": "integer value of parameter",
        "boolValue": "boolean value of parameter"
      },
      {
        "name": "doc_id",
        "value": "the doc_id value",
        "intValue": "integer value of parameter",
        "boolValue": "boolean value of parameter"
      },
      {
        "name": "doc_title",
        "value": "the doc_title value",
        "intValue": "integer value of parameter",
        "boolValue": "boolean value of parameter"
      },
      {
        "name": "doc_type",
        "value": "the doc_type value",
        "intValue": "integer value of parameter",
        "boolValue": "boolean value of parameter"
      },
      {
        "name": "owner",
        "value": "the owner value",
        "intValue": "integer value of parameter",
        "boolValue": "boolean value of parameter"
      }
      ]
     }
    ]
   },
  ]
 }
1

There are 1 answers

0
SGC On

Drive activity reports are available ONLY for Google Apps Unlimited customers. Also. Is it happening only for "rename" event?? Is activity not showing up at all or is it taking time? Generally activity report takes with in few hours to a day but not more than 24hrs. check this link. Last approach is not limited only to Google Apps unlimited accounts.