【问题标题】:People API not creating birthday when date object is passed传递日期对象时,人员 API 未创建生日
【发布时间】:2021-11-15 14:37:02
【问题描述】:

我想创建一个联系人,我需要在生日日历中创建条目。因此我使用 people API 来创建生日日期

我正在关注此文档https://developers.google.com/people/api/rest/v1/people#Person.Birthday

Click here to open the API builder

personFields 设置为

names,birthdays,phoneNumbers,memberships

我将 person 对象传递为

{
  "phoneNumbers": [
    {
      "type": "work",
      "value": "(266) 581-6706"
    }
  ],
  "names": [
    {
      "unstructuredName": "Bradley"
    }
  ],
  "birthdays": [
    {
      "date": {
        "year": 2012,
        "month": 10,
        "day": 13
      }
    }
  ],
  "memberships": [
    {
      "contactGroupMembership": {
        "contactGroupResourceName": "contactGroups/myContacts"
      }
    }
  ]
}

但是 API 确实使用"text": "10/13/2021" 创建了一个日期,这是没有用的,因为此方法不会在生日日历中创建条目。我期待通过日期对象。谁能告诉我,我是否遗漏了什么

curl --request POST \
  'https://people.googleapis.com/v1/people:createContact?personFields=names%2Cbirthdays%2CphoneNumbers%2Cmemberships&key=[YOUR_API_KEY]' \
  --header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{"phoneNumbers":[{"type":"work","value":"(266) 581-6706"}],"names":[{"unstructuredName":"Bradley"}],"birthdays":[{"date":{"year":2012,"month":10,"day":13}}],"memberships":[{"contactGroupMembership":{"contactGroupResourceName":"contactGroups/myContacts"}}]}' \
  --compressed

【问题讨论】:

    标签: google-people-api


    【解决方案1】:

    有一个新的bug 影响生日的设置

    我建议您给它“加星标”以提高知名度,这样它有望更快地得到修复。

    【讨论】:

      猜你喜欢
      • 2018-08-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-15
      • 2013-05-06
      • 2016-03-15
      • 2018-07-25
      相关资源
      最近更新 更多