Google联系人API更新联系人 - 未找到

时间:2015-01-27 18:49:10

标签: php updates google-contacts http-status-code-401

因此,我可以检索联系人并插入联系人,但我在更新联系人时遇到问题。我得到的只是404"未找到"错误。 xml格式正确,因为我可以插入,但似乎我使用的URL不起作用?我试过了:

https://www.google.com/m8/feeds/contacts/{my email}/full/{contact id}

我也尝试过:

https://www.google.com/m8/feeds/contacts/default/full/{contact id}

并且还使用了从检索查询返回的ID:

http://www.google.com/m8/feeds/contacts/{my email}/base/{contact id}

我发送的标题是:

Content-Type: application/atom+xml
Depth: 1
Authorization: Bearer {Auth Code}
GData-Version: 3.0
If-Match: *

更多详情: 我修改了我的代码,以便当它执行联系人的GET时,它会从联系人XML中获取编辑链接:

https://www.google.com/m8/feeds/contacts/awallace%40ihouseweb.com/full/{contactID}

并将其用于URL,并确保我使用" PUT"由:

curl_setopt($curl, CURLOPT_PUT, true);

现在它的行为有所不同 - 它说我需要登录:

<internalReason>Login Required</internalReason>

即使我的Auth令牌在另一个小时内有效。精氨酸。

感谢, 安迪

0 个答案:

没有答案