如何使用admin,reports_v1和gapi.client.reports.activities.list获取重命名操作列表?

时间:2015-06-10 06:40:59

标签: google-admin-sdk

在身份验证到位并正常工作的情况下,我对reports.activities.list进行了以下调用,但我得到的响应并不是我所期望的,我无法弄清楚如何从中获取,以及示例输出列于:https://developers.google.com/admin-sdk/reports/v1/guides/manage-audit-drive

我正在使用的电话:

    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);
        });
    });

我得到了什么:

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

我的期望:

{
 "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": "liz@example.com",
   "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 个答案:

答案 0 :(得分:0)

仅适用于Google Apps Unlimited客户的云端硬盘活动报告。也。它只发生在"重命名"事件??活动根本没有出现还是需要时间?一般来说,活动报告需要几小时到一天但不超过24小时。检查这个link。 最后一种方法不仅限于Google Apps无限帐户。