I am trying to create a contact using the following XML using php. Is there something wrong with my XML or PHP? <entry xmlns="http://www.w3.org/2005/Atom"> <title type="text"> </title> <updated>2011-07-25T20:06:25Z</updated> <author><name>Garment Graphics Website</name></author> <id>data:,none</id> <summary type="text">Contact</summary> <content type="application/vnd.ctct+xml"> <Contact xmlns="http://ws.constantcontact.com/ns/1.0/"> <EmailAddress>test@gmail.com</EmailAddress> <OptInSource>ACTION_BY_CONTACT</OptInSource> <ContactLists><ContactList id="http://api.constantcontact.com/ws/customers/Garmentgraphics/lists/43"/><ContactList id="http://api.constantcontact.com/ws/customers/Garmentgraphics/lists/45"/><ContactList id="http://api.constantcontact.com/ws/customers/Garmentgraphics/lists/46"/><ContactList id="http://api.constantcontact.com/ws/customers/Garmentgraphics/lists/50"/><ContactList id="http://api.constantcontact.com/ws/customers/Garmentgraphics/lists/48"/><ContactList id="http://api.constantcontact.com/ws/customers/Garmentgraphics/lists/7"/><ContactList id="http://api.constantcontact.com/ws/customers/Garmentgraphics/lists/47"/></ContactLists> </Contact> </content> </entry> the following is my php code: $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, PARAM_API_KEY . '%' . PARAM_USER_NAME . ':' . PARAM_PASSWORD); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/atom+xml')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $xml = curl_exec($ch); $result = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch);
... View more