试图检索单个联系人。在链接中,它说:
public static Contact retrieveContact(ContactsRequest cr)
{
Contact contact = cr.Retrieve<Contact>("https://www.google.com/m8/feeds/contacts/default/full/contactId");
return contact;
}
怎么知道联系人的自链接 URL,甚至是contactId?我尝试了不同的变体:
https://www.google.com/m8/feeds/contacts/default/full/firstname.lastname https://www.google.com/m8/feeds/contacts/ourdomain.com/full/firstname.lastname https: //www.google.com/m8/feeds/contacts/firstname.lastname%40ourdomain.com/full/firstname.lastname
但我似乎无法获得正确的返回值。我得到的只是未找到异常。
完整的错误信息是:
{“远程服务器返回错误:(404)未找到。”}
我能够连接到该服务,因为如果我检索所有联系人,我就可以进行适当的查询。但是在检索单个联系人时有点难过。
有人已经在这方面工作了吗?
感谢任何建议。
更新:例如,如果您使用 ContactsQuery,例如:
ContactsQuery query =
new ContactsQuery("https://www.google.com/m8/feeds/profiles/domain/" + this.domain + "/full");
query.Query = ?????
我们可以在查询对象中指定什么以便我们实际上只检索一个用户(基于用户名或电子邮件地址)?
更新:我使用 GAM ( https://code.google.com/p/google-apps-manager/ ) 来检索特定用户,那里有一个由一堆数字组成的 ID 字段。我尝试使用它来代替上面 URI 中的 ContactID 字段,但所有变体都只返回 403 Not Found 错误。