Google AdminDirectory api不更新地址

时间:2015-04-10 18:08:52

标签: google-apps-script google-admin-sdk user-profile

我正在尝试使用以下应用脚本更新用户的覆盖率配置文件属性。它正在更新除地址之外的所有字段。如果我错过任何东西,请建议。以下是代码的一部分:

  var resource = {
    organizations:
    [{title: designation,
      department: department,
     }],
    addresses: [
      {
        locality: "Pune",
        streetAddress:"Kothrud",
        postalCode:"411038",
        primary:true,
        region:"Maharashtra",
        type: "work",
      }
    ],
    phones: [{
      type: "work",
      value: phone,
      },
      {
      type: "mobile",
      value: mobile,
      },
      {
      customType: "Extension",
      value: land_line,
      },
      {
     customType:"Middle Name",
     value: middle,
     }],
  }

  var result = AdminDirectory.Users.update(resource, email_address)

1 个答案:

答案 0 :(得分:0)

您可以尝试result = AdminDirectory.Users.patch(resource, userId);

而不是更新

API链接供您参考here

希望有所帮助!