Error 4834 when using the insertRecords method for Contacts
Hello, I'm trying to insert multiple contacts using the ZoHo API with PHP, but I receive an Invalid ticket ID error when trying to use the insertRecords method. The authtoken I'm using is correct and the same I use with the getRecords method, that works perfectly.
Here is the POST data I'm sending:
"authtoken" => $authtoken,
"scope" => "crmapi",
"newFormat" => "1",
"duplicateCheck" => "1",
"version" => "4",
"xmlData" =>
- <?xml version='1.0' encoding='UTF-8' ?>
<Contacts>
<row no="1">
<FL val="First Name">Contact1</FL>
<FL val="Last Name">Lastname1</FL>
</row>
<row no="2">
<FL val="First Name">Contact2</FL>
<FL val="Last Name">Lastname2</FL>
</row>
</Contacts>
I send the request with CURL, here is the response:
HTTP/1.1 100 Continue HTTP/1.1 200 OK Server: ZGS Date: Wed, 02 Oct 2013 08:48:18 GMT Content-Type: text/xml;charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive Set-Cookie: bba2ee81f8=0a46afd37679736317d86bcdb5c70fce; Path=/ Set-Cookie: JSESSIONID=84008081EBBE4F551B47A6B8540156F5; Path=/crm Set-Cookie: crmcsr=e9e3bbab-e0a4-48bd-8a26-760f82238b14; Path=/; Secure Pragma: no-cache Cache-Control: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Strict-Transport-Security: max-age=432000 4834Invalid Ticket Id
Is it possible that the XML data is badly encoded? How should I send it?
Any help will be appreciated, thank you.