人们 API 'copyOtherContactToMyContactsGroup' 返回 404 错误

People API 'copyOtherContactToMyContactsGroup' is returning a 404 error

我正在尝试通过人员 API 自动将“隐藏”/“其他联系人”移动到“我的联系人”group/membership,但我收到 404 未找到错误。

我的简化代码如下所示:

function copyOtherContactToMyContactsGroup() {

    var otherContactsList = People.OtherContacts.list({
        pageSize:10,
        readMask: 'emailAddresses,names,phoneNumbers',
    });

    var otherContacts = otherContactsList.otherContacts;

    for(var oC in otherContacts) {
        var resourceName    = otherContacts[oC].resourceName;
        People.OtherContacts.copyOtherContactToMyContactsGroup(resourceName, {"copyMask": "emailAddresses,names,phoneNumbers"});
    };
}
var resourceName    = "otherContacts/c1528566360341757340";

我已成功使用具有上述资源名称的 API 资源管理器。

感谢您的帮助或建议。

看来您遇到的问题实际上可能是一个错误。

考虑到这一点,我已经提交了关于 Google 的问题跟踪器 here 的报告。

我建议您给问题加注星标,并最终添加一条评论,说明您受到了它的影响,因为任何更新都会发布在那里。

谢谢@ale13

Google回复说JSON需要放在resourceName之前。

更正代码行

People.OtherContacts.copyOtherContactToMyContactsGroup({"copyMask": "emailAddresses,names,phoneNumbers"}, resourceName);