Deleting a forwarder using API

Megalan-Robert

Verified User
Joined
Oct 15, 2005
Messages
21
I used the php class for communicating with DA to create a forwarder. I sent out the following and it nicely created the forwarder.

Code:
$sock->query('/CMD_EMAIL_FORWARDER',
	array(
		'action' => 'create',
		'domain' => '---domain---',
		'user' => '---user---',
		'email' => '---destination---',
		'create' => 'Create'
    ));

Now I want to use this as a toggle function, so I want to be able to remove the forwarder just as easily and I used:


Code:
$sock->query('/CMD_EMAIL_FORWARDER',
	array(
		'action' => 'delete',
		'domain' => '---domain---',
		'user' => '---user---',
		'delete' => 'delete'
    ));
This doesn't seem to work.

I tried looking at the skins tutorials which variables to pass on to the httpsocket.php but I'm kinda stuck. Where can I find which variables to pass on with regard to each function? Is there a list that can guide me as to what to pass on?

And what am I doing wrong with the above code? Though if I know which variables to pass on, I probably can figure it out myself ;)

Regards
 
I do it this way and it works great:

PHP:
$sock->set_method('POST');
$sock->query('/CMD_API_EMAIL_FORWARDERS',
   array(
      'action' => 'delete',
      'domain' => $domain,
      'select0' => $account
      )
   );
$result = $sock->fetch_parsed_body();
 
Back
Top