2
更新現有ContactEntry以將GroupMembershipInfo包括在現有ContactGroupEntry中的正確方法是什麼?能夠從ContactEntry中刪除GroupMembershipInfo,但無法添加GroupMembershipInfo
我使用的Java API com.google.gdata.data.contacts ...
// groupNameId was fetched with ContactGroupEntry.getId()
// entry is a known-good ContactEntry
// contactsService is a properly authenticated feed
GroupMembershipInfo g = new GroupMembershipInfo();
g.setHref(groupNameId);
entry.addGroupMembershipInfo(g);
contactsService.update(new URL(entry.getEditLink().getHref()), entry);
// .... fails with PreconditionFailedException
我能夠成功地檢索聯繫人,並刪除組成員,但添加組成員身份是逃避我,我一直無法找出正確的谷歌搜索找到的示例代碼一個有用的片段