XML API for PHP
Using the XML API, data in Centric CRM can be retrieved using various clients. While a toolset has not been made specifically for PHP, the following has been used to interact with Centric CRM and PHP...
<? // Site to post to $server = "www.your_crm_server.com" $path = "/centric/ProcessPacket.do" // Begin the transfer $socket = fsockopen($server, 80); if (!$socket) { // error: could not connect to server // return } else { // Post the XML document $request = "POST " . $path . " HTTP/1.0\r\n" . "Host: " . $server . "\r\n" . "Content-Type: text/xml\r\n" . "Content-Length: " . strlen($xmlDocument) . "\r\n\r\n" . $xmlDocument; if (!fputs($socket, $request, strlen($request))) { // error: could not write to server // return } $response = ''; while ($data = fread($socket, 32768)) { $response .= $data; } fclose($socket); if ($response = '') { // error: no response from server // return } else { // review the response for status } } ?>
Some things to keep in mind...
- The XML needs to be well-formed
- Errors in the response provide some questions... see the FAQ
Sign in to add your comment.