[API] CMD_API_TICKET_CREATE does not work

JeroenOomen

New member
Joined
May 6, 2006
Messages
4
Hello,

I try to let user make their tickets by the DA API system, bit i think the command
"CMD_API_TICKET_CREATE" does not work for some kind of reason.

Every time i post a ticket, I get this error:

You cannot execute that command

Details

The request you've made cannot be executed because it does not exist in your authority level


This is my code:

Code:
require  $path_to_disk."includes/directadmin_phpapi/httpsocket.php";

$sock = new HTTPSocket;
		
		$sock->connect('####',2222);
		$sock->set_login( "myusername", "mypassword");

//login works correctly, i checked it with login check api
					

$sock->set_method('POST');
		
		$sock->query('/CMD_API_TICKET_CREATE', 
		
						array (
								
								"action" => "create",
								"type" => "request",
								"user"=>"creator",
								"priority"=>"20",
								"subject"=>"your subject",
								"message"=> "your message"

								
								));
			
												
								$daresult = $sock->fetch_body();
								
								print_r ( $daresult );
												echo"ok";

}

?>

<div class=kop>Ticket Toevoegen</div><br>
	<SCRIPT>
		function check(f) {
			if( info.subject.value.length == 0 )
				alert("U moet nog het onderwerp invullen");
			else if( info.message.value.length == 0 ) 
				alert("U moet nog uw vraag stellen");
			else
				info.submit();
		}
	</SCRIPT>
		<FORM METHOD=POST NAME=info ONSUBMIT="check(this);return false;" action="?">
			<input type=hidden name="action" value="create">
			<input type=hidden name="type" value="request">
			<input type=hidden name="user" value="creator">
			<input type=hidden name="priority" value="20">
			



                     

			<TABLE CELLPADDING=2 CELLSPACING=0 BORDER=0>
			<TR><TD WIDTH=100>Onderwerp:</TD><TD><INPUT SIZE=30 TYPE=TEXT NAME="subject" ></TD></TR>
			<TR><TD WIDTH=100 VALIGN=TOP>Vraag:</TD><TD><TEXTAREA COLS=70 ROWS=24 WRAP=HARD name="message"></TEXTAREA></TD></TR>
			<TR><TD COLSPAN=2 ALIGN=RIGHT><INPUT TYPE=SUBMIT name=submit VALUE="Verstuur"></TD></TR>
			</TABLE>
		</FORM>

		<SCRIPT>
			if(document.info.subject.value=="")
				document.info.subject.focus();
			else
				document.info.body.focus();
		</SCRIPT>

What is it I do wrong? Or is it a Bug?
 
Last edited:
I have send an e-mail to support.

Other people do have the same problem with this API-command.

edit:

I got some new binaries from John, it was a little bug.

In the next update of DA the bug will be solved.
 
Last edited:
Back
Top