Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $accountno = $account_id;
- //to insert data into the system we need a valid hash
- $hash = "a4d70e75d403e037c7a537bcac2be9c2";
- $notify = "myles.panayiotis@oneradar.com";
- //define what area to insert to
- $area = "250";
- //creating the xml document
- $doc = new DOMDocument('1.0');
- $doc->formatOutput = true;
- //everything is contained in the import data tag
- $importdata = $doc->createElement("importdata");
- $doc->appendChild($importdata);
- //Element for target area
- $area = $doc->createElement("area",$area);
- $importdata->appendChild($area);
- //Create data tag
- $data = $doc->createElement("data");
- //Create Notify element
- $notify = $doc->createElement("notify",$notify);
- $data->appendChild($notify);
- $importdata->appendChild($data);
- //Create account tag
- $account = $doc->createElement("account");
- //Create account number if using custom number, uncomment 2 lines below
- $accountno = $doc->createElement("accountno",$accountno);
- $account->appendChild($accountno);
- $j = $doc->createElement("field","Uploadededed");
- $j->setAttribute("table", "RCMANL");
- $j->setAttribute("field", "ANAL77");
- $account->appendChild($j);
- $j = $doc->createElement("field","Tech insight");
- $j->setAttribute("table", "SPECIAL");
- $j->setAttribute("field", "ACTIVITY");
- $account->appendChild($j);
- $j = $doc->createElement("field","Tech insight whitepaper click - Lead confirmed");
- $j->setAttribute("table", "SPECIAL");
- $j->setAttribute("field","COMMENTS");
- $account->appendChild($j);
- $j = $doc->createElement("field","closed");
- $j->setAttribute("table", "TELCOM");
- $j->setAttribute("field", "SUBSTATUS");
- $account->appendChild($j);
- $j = $doc->createElement("field","This is a test");
- $j->setAttribute("table", "TELCOM");
- $j->setAttribute("field", "CUSTOMERSTATUS");
- $account->appendChild($j);
- $data->appendChild($account);
- $xml = $doc->saveXML();
- //Change this to the long url of your system, if unsure what this is
- //please ask support
- $url = "https://europe4.callprocrm.com/609839/api.php?mode=import&hash=" . $hash;
- //start curl
- $ch = curl_init();
- //set the url, number of POST vars, POST data
- $data = array("xml" => $xml);
- curl_setopt($ch,CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
- $result = curl_exec($ch);
- curl_close($ch);
- //echo $result;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement