我已成功添加、修改联系人,但无法删除联系人。 这是我的请求,但我仍然收到这个错误,我不确定问题是什么,它必须与我的“内容”有关,但我不确定缺少了什么。如果能为您提供任何信息,我们将不胜感激!
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>
错误: 400这是个错误。 您的客户端发出了格式错误或非法的请求。这就是我们所知道的。
注: 我正在尝试,曼努埃尔·莱莫斯班: http://www.phpclasses.org/package/7700-PHP-Authorize-and-access-APIs-using-OAuth.html
我在曼努埃尔的论坛上收到了他的回复。
以下是答案。
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);