【发布时间】:2015-11-13 16:03:35
【问题描述】:
我正在编写一个函数来更新用户的信息。我做到了,它工作正常,但是当我想使用自定义模式时它不起作用。我检查了reference,但它显示错误 "Invalid Input: [employmentData] "
function directoryUpdate(userId, userDept, userLocation, userPhone,userTitle) {
var userId = 'devtest@pruebatest.com',userDept='D003', userLocation='L003';
var userTitle='T003';
var update = {
ims:
[{
type: "work",
protocol: "gtalk",
im: "liz_im@talk.example.com",
primary: true
}],
emails: [
{
address: "liz@example.com",
type: "home",
customType: "",
primary: true
}
],
addresses:
[{
type: "home",
customType: "",
streetAddress: "1600 Amphitheatre Parkway",
locality: "Mountain View",
region: "CA",
postalCode: "94043"
}
],
organizations:
[{
name: "Next Step",
title: userTitle,
primary: true,
type: "work",
department: userDept,
location: userLocation
}],
customSchemas: {
employmentData: {
employeeNumber: "123456789",
jobFamily: "Engineering",
location: "Atlanta",
jobLevel: 8,
projects: [
{ value: "GeneGnome", customType: "development" },
{ value: "Panopticon", customType: "support" }
]
}
}
};
update = AdminDirectory.Users.patch(update, userId);
Logger.log('User %s updated with result %s.', userId, update)
return true;
}
什么是错误?
您好,提前致谢。
【问题讨论】:
-
我尝试了相同的基本字段,如姓名、ID 等......但它也不起作用。
标签: google-apps-script google-directory-api google-admin-sdk