我正在尝试使用Directory API更新客户对象,但尝试修改顶级的任何内容会导致返回400(无效客户语言)错误.
这是初始对象的获取(一些项目是为隐私而编辑的)
请求
GET https://www.googleapis.com/admin/directory/v1/customers/<customerID>
响应
200 OK
{
 "kind": "admin#directory#customer",
 "id": "<customerID>",
 "etag": "\"<etag>\"",
 "customerDomain": "<domainName>",
 "alternateEmail": "<email>",
 "postalAddress": {
  "contactName": "<name>",
  "organizationName": "",
  "locality": "<city>",
  "region": "<state>",
  "countryCode": "US",
  "addressLine1": "<address1>",
  "addressLine2": "",
  "addressLine3": "",
  "postalCode": "<zip>"
 },
 "phoneNumber": "<phoneNumber>",
 "language": "en",
 "customerCreationTime": "2011-03-31T03:45:49.408Z"
}
然后尝试单独更新电话号码或语言会导致错误.如果我使用补丁或更新呼叫并不重要.
电话号码补丁电话:
{
  "phoneNumber": "+18005551234"
}
语言补丁调用:
{
  "language": "en-GB"
}
补丁或更新呼叫响应
400 OK
{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "Invalid Customer language"
   }
  ],
  "code": 400,
  "message": "Invalid Customer language"
 }
}
现在,我只是在使用在线工具(https://developers.google.com/admin-sdk/directory/v1/reference/customers/patch),然后再将其添加到代码中.我没有在文档,论坛,问题跟踪器或此处找到解决问题的任何内容; 任何帮助将不胜感激!
看起来这是在线工具的一个错误。我能够使用 GAM 的更新版本 ( https://github.com/jay0lee/GAM ) 成功操作该对象,并准备好继续前进。我将把它留在这里,以防其他人遇到这个问题。
| 归档时间: | 
 | 
| 查看次数: | 654 次 | 
| 最近记录: |