2
我想添加聯繫人到谷歌聯繫人的組。當我在Google的「OAuth 2.0遊樂場」中試用它時,它可以正常工作,但是從我的web應用程序中,使用完全相同的標題,發佈方式和正文,我得到「錯誤400:錯誤的請求」。我如何添加聯繫人到谷歌聯繫人組中的一個V3 v3
這是我的代碼(PHP):
$contact = '<?xml version="1.0"?>
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005">
<gd:name> <gd:fullName>Jack Frost</gd:fullName> </gd:name>
<gd:email address="[email protected]" rel="http://schemas.google.com/g/2005#home"/>
<gd:organization rel="http://schemas.google.com/g/2005#work">
<gd:orgName>Winter Inc.</gd:orgName> </gd:organization>
<gd:phoneNumber rel="http://schemas.google.com/g/2005#home"> (206)555-1213 </gd:phoneNumber>
<gContact:groupMembershipInfo deleted="false" href="http://www.google.com/m8/feeds/groups/[email protected]/base/MY_GROUP_ID"/>
</atom:entry>';
$url = 'https://www.google.com/m8/feeds/contacts/[email protected]/full/';
$method= 'POST';
$headers = ["Host" => "www.google.com", "Gdata-version" => "3.0","Content-length" => strlen($contact), "Content-type" => "application/atom+xml"];
$result = $googleService->request($url,$method,$contact,$headers);
當我離開了groupMembershipInfo位,它的工作原理。
約阿希姆
這似乎不適合我。我認爲它將不得不與'gContact:groupMembershipInfo'元素? –