【问题标题】:People API getting error when Age Ranges is specified指定年龄范围时,人员 API 出现错误
【发布时间】:2021-10-22 12:01:20
【问题描述】:

我已尝试使用人员联系人创建 API,但出现错误。我相信 ENUM 数据是正确的

这发生在技能和年龄范围

{
  "error": {
    "code": 400,
    "message": "person.age_ranges is a read only field.",
    "status": "INVALID_ARGUMENT"
  }
}

People.People.createContact(  {"skills": [
    {
      "value": "Playing"
    }
  ],
  "ageRanges": [
    {
      "ageRange": "TWENTY_ONE_OR_OLDER"
    }
  ],

})

【问题讨论】:

    标签: google-apps-script contacts google-people-api


    【解决方案1】:

    答案:

    ageRanges[] 字段不能设置,因为它是只读字段。

    更多信息:

    根据documentation中的Person资源:

    ageRanges[] object (AgeRangeType)
    Output only. The person's age ranges

    由于这是一个仅输出值,因此无法通过调用 people.createContact 来写入。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-10-22
      • 2015-04-14
      • 2015-07-17
      • 1970-01-01
      • 2013-12-16
      • 1970-01-01
      • 2016-06-28
      • 2014-05-16
      相关资源
      最近更新 更多