your API looks great nice and clean,
I am search for an option to create(register) a user, update his password and delete a user.
I want to control the user credentials from my system, once a user created in my system it will automatically created with same l/p in kayako.
I found some example which does it via swift.php inclusion, then I found your API which itroduced much more features,one of them is 'updateEmailAddress' which answers one of my needs to change user's email.
Say I can use this script to register a new user:
<?
define("SWIFT_AREA", 40);
require_once ("./swift.php");
//$_REQUEST[email] = "johndoe@domain.com";
//$_REQUEST[password] = "password";
//$_REQUEST["fullname"] = "John Doe";
$enabled = 1; // user is validated
$_SWIFT["tgroup"]["regusergroupid"] = 2; // registered users group is 2 by default
$_SWIFT["languageid"] = 1; // default language is 1
$userid = insertUser($enabled, $_REQUEST["email"], $_REQUEST["password"], $_SWIFT["tgroup"]["regusergroupid"], LOGINAPI_DEFAULT, 0, $_REQUEST["fullname"], $_SWIFT["languageid"], 0, false, 1);
if (!$userid)
{
$error = "Email address already exists";
} else {
updateCustomFields(CUSTOMFIELD_USER, $userid);
$dotemplate = iif($enabled==1,"registersuccess", "registervalidate");
}
?>
But how can i change a user password or delete user?
thank you.
Sign In »
Register Now!
Help

Back to top








