Not Able to create record into Manage Engine using XML- PHP (Rest Api)

Not Able to create record into Manage Engine using XML- PHP (Rest Api)

Hi All,

              I am trying to create the record into manage engine using php curl request , as well as I am generating the xml file , but when I am running my script .  I am getting the xml response

like this:-

<operation name="ADD_REQUEST">
<result>
<status> Failed </status>
<message> No input data for creating request </message>
</result>
</operation>

Given below is my code, which I am executing:-

<?php

 $operation = new SimpleXMLElement('<Operation/>');
 $details = $operation->addChild('Details');
 $details->addChild('requester', "Kumar");
 $details->addChild('subject', "Hardware");
 $details->addChild('description', "RAM ISSUE");
 $details->addChild('priority', "High");


Header('Content-type: text/xml');
$xmldata = $operation->asXML();

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_MUTE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmldata);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
print_r($output);
curl_close($ch);

Please help me...Its urgent for me..

                  New to ADSelfService Plus?