简体   繁体   English

Google通讯录API - 删除联系人(400错误)

[英]Google Contacts API - Delete Contact (400 Error)

I have been able to successfully, Add, Modify, but cannot delete a contact. 我已经能够成功添加,修改,但无法删除联系人。 This is my request, but I continue to receive this error, and i'm not sure the issue, it has to be with my 'content', but i'm not sure what is missing. 这是我的要求,但我仍然收到这个错误,我不确定问题,它必须与我的'内容',但我不知道缺少什么。 Any light shed upon this would be greatly appreciated! 任何光照在这上面将非常感谢!

URL REQUEST:
https://www.google.com/m8/feeds/contacts/{userEmail}/full/{contactId}

METHOD: DELETE
XML CONTENT:
<entry etag='*'><id>https://www.google.com/m8/feeds/contacts/{userEmail}/full/54934b770f18de29</id>
</entry>

ERROR: 400 That's an error. 错误: 400这是一个错误。 Your client has issued a malformed or illegal request. 您的客户发出了格式错误或非法的请求。 That's all we know. 我们知道的就这些。

NOTE: I am trying out, Manuel Lemos Class: http://www.phpclasses.org/package/7700-PHP-Authorize-and-access-APIs-using-OAuth.html 注意:我正在尝试,Manuel Lemos班级: http ://www.phpclasses.org/package/7700-PHP-Authorize-and-access-APIs-using-OAuth.html

I received an answer from Manuel on his forum. 我在他的论坛上收到曼努埃尔的答复。

Here is the response. 这是回复。

api_url = 'https://www.googleapis.com/some-google-api-url';
$options = array(
'RequestHeaders'=>array(
'If-Match'=>'if match value here', 
'FailOnAccessError'=>true
);
$success = $client->CallAPI($api_url, 'DELETE', array(), $options, $results);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM