G
GilesW
Guest
I have been trying to create an email account with the API now for 2 hours and it is killling me. This is the code that is relevant to the issue I have.
===
$emailxml = '<packet version="1.4.2.0">
<mail>
<create>
<filter>
<domain_id>127</domain_id>
<mailname>
<name>giles.wells</name>
<mailbox>
<enabled>true</enabled>
</mailbox>
<password>thisisapassword</password>
<password_type>crypt</password_type>
<permissions>
<cp_access>true</cp_access>
</permissions>
</mailname>
</filter>
</create>
</mail>
</packet>';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://www.inthesuntech.com:8443/enterprise/control/agent.php");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_HTTPHEADER,array("HTTP_AUTH_LOGIN"=> "{nottellingyou}",
"HTTP_AUTH_PASSWD:" =>"{stillnottellingyousodontask}",
"HTTP_PRETTY_PRINT:" => "TRUE",
"Content-Type:" => "text/xml")
);
curl_setopt($curl, CURLOPT_POSTFIELDS, "$emailxml");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$emailoutput = curl_exec($curl);
curl_close($curl);
print_r($emailoutput);
die();
===
I bet I am missing something somewhere. I have gotten pass the wrong login credentials and am currently getting this response with every attempt.
===
<?xml version="1.0"?>
<packet version="0.0.0.0">
<system>
<status>error</status>
<errcode>1003</errcode>
<errtext>Wrong request</errtext>
</system>
</packet>
===
What am I doing wrong?
===
$emailxml = '<packet version="1.4.2.0">
<mail>
<create>
<filter>
<domain_id>127</domain_id>
<mailname>
<name>giles.wells</name>
<mailbox>
<enabled>true</enabled>
</mailbox>
<password>thisisapassword</password>
<password_type>crypt</password_type>
<permissions>
<cp_access>true</cp_access>
</permissions>
</mailname>
</filter>
</create>
</mail>
</packet>';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://www.inthesuntech.com:8443/enterprise/control/agent.php");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_HTTPHEADER,array("HTTP_AUTH_LOGIN"=> "{nottellingyou}",
"HTTP_AUTH_PASSWD:" =>"{stillnottellingyousodontask}",
"HTTP_PRETTY_PRINT:" => "TRUE",
"Content-Type:" => "text/xml")
);
curl_setopt($curl, CURLOPT_POSTFIELDS, "$emailxml");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$emailoutput = curl_exec($curl);
curl_close($curl);
print_r($emailoutput);
die();
===
I bet I am missing something somewhere. I have gotten pass the wrong login credentials and am currently getting this response with every attempt.
===
<?xml version="1.0"?>
<packet version="0.0.0.0">
<system>
<status>error</status>
<errcode>1003</errcode>
<errtext>Wrong request</errtext>
</system>
</packet>
===
What am I doing wrong?