Jump to content

How can i get CLIENTID when i added client using API


Recommended Posts

When I am trying to add client using WHMCS External API - this does not return me client_id nor any error message, this is because at the same time I called a hook to add client for my other application where I need to redirect the page.

 

<?php

function funConnect_mantis_client($vars) {

 

$url = 'http://nliventech.net/bugtracking/connect_mantis.php?sername='.$vars['email'].'&email='.$vars['email'].'&realname='.$vars['firstname']." ".$vars['lastname'].'&password='.$vars['password'].'&password_verify='.$vars['password'].'&enabled=1&access_level=25' ;

echo '<meta http-equiv="refresh" content="0;url='.$url.'" target="_blank" />';

}

add_hook("ClientAdd",1,"funConnect_mantis_client";

?>

 

I want CLIENTID as well as this redirection. Is this this possible ? How can i do this?

Link to comment
Share on other sites

if you need to send these parameters to the mentioned URL from action hook, you can do it like below:

<?php

function hook_createRemoteUser($vars){
   $url = 'http://nliventech.net/bugtracking/connect_mantis.php?';
   $url .= 'sername='.urlencode($vars['email']).'&email='.urlencode($vars['email']);
   $url .= '&realname='.urlencode($vars['firstname']).' '.urlencode($vars['lastname']);
   $url .= '&password='.urlencode($vars['password']).'&password_verify='.urlencode($vars['password']);
   $url .= '&enabled=1&access_level=25';

   curlCall($url, array(), array());
}
add_hook("ClientAdd", 1, "hook_createRemoteUser");

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated