Users
Provides user management functionality.
The following operations are supported. For a formal definition, please review the Service Description.
-
CreateAccount
Create a new user account. Returns WebServices of account created. Requires admin priv.
Parameters:
long admin_wsid : WebServicesID of account that will create the new account. This must be an admin account.
string admin_pw : Password of admin account
string userid : Desired UserID of new user. Must be unique.
string name : Name of user
string email : Email of user
string password : Password of user.
string privileges : Privileges of user. Defaults to null.
int emaillevel : Describes when to send automatic email to this user. Valid values are below
0 = do not send automated mail to this user
1 = send automated mail when non-quick jobs fail
2 = send automated mail when non-quick jobs complete successfully
3 = send automated mail in either of the above two cases
short gvisible : Determines whether a user is visible for group membership. 1 for yes, 0 for no.
Output:
long : A unique identifier of the newly created account, also referred to as WebServicesID, or just wsid.
-
DeleteAccount
Fully removes an account from the system. Requires admin priv. This method has no output when succesful.
Parameters:
long admin_wsid : WebServicesID of admin user.
string admin_pw : Password of admin account
long deleteme : WebServicesID of account to delete
Output:
Void -
GetUsers
Returns an array of CJUser objects representing all users that match the criteria in conditions.
Conditions is a formatted string of the same format of that used in Jobs.FindJobs() (in the jobs.asmx web service).
Please see Jobs.FindJobs() for further documentation on the conditions string.
The wsid of the user calling this method must have the admin priv.
The following are valid conditions keys:
string userid : unique string identifier of user
string name : user's full name
string email : user's email
string privileges : user's privileges
short gvisible : Determines whether a user is visible for group membership. 1 for yes, 0 for no.
long wsid : unique numeric identifier of user
int emaillevel : Describes when to send automatic email to this user. See CreateAccount for appropriate values
DateTime timecreated: account creation date of user
Parameters:
long admin_wsid : WebServicesID of admin account.
string admin_pw : Password of that account
string conditions : A formatted string describing the conditions for the search. See above for details on this.
Output:
CJUser[] : Contains objects matching conditions
A CJUser object contains:
string userid : unique string identifier of user
string name : user's full name
string email : user's email
string privileges : user's privileges
bool gvisible : Determines whether a user is visible for group membership.
long webservicesid : unique numeric identifier of user
int emaillevel : Describes when to send automatic email to this user. See CreateAccount for appropriate values
DateTime timecreated: account creation date of user
string password : This is always returned as null. Field exists so it may be updated from UpdateAccount()
-
UpdateAccount
Update account described by 'wsid' with information described in 'user' param.
The WebServicesID in 'user' determines which user's account is updated and must match the parameter 'wsid'; users may only update their own account.
Fields left null in the User object will also be updated as null in the db.
The 'Privileges' and 'Password' fields are exceptions to this rule; null values in these fields will not override existing values.
Parameters:
long wsid : WebServicesID of account to update.
string pw : Password of that account
CJUser user : Object containing user parameters to update. See GetUsers() for CJUser field documentation.
Output:
bool : true if successful, false otherwise