Skip to main content

Managing Users

To allow a user with the appropriate authorizations to retrieve the list of all users in the system (including users ID) and delete one or more of these users, the following methods were introduced to the SDK:

  • GetAllUsers - allows the API client to get a list of all users in the system that are visible to the current user. For details, see GetAllUsers Method.

  • DeleteUser - allows the API client to delete a user in the system. For details, see DeleteUser Method.

DeleteUser Method

CxSDKWebService.DeleteUser Method

public CxWSBasicResponseDeleteUser(stringsessionID,intuserID);

Parameters

  • sessionID: The current Session ID

  • userID: The user ID of the user to be deleted.

Return Value

CxWSBasicResponse, including:

  • IsSuccessful: Indicates that the user has been successfully deleted, in which case the message "User deleted" is displayed.

Example

To delete a user:

internal void Main( string [] args) { String sessionID = args[0]; int userId = int.Parse(args[1]); CxSDKWebService cxSDKProxy = new CxSDKWebService(); CxWSResponseGroupList response = cxSDKProxy.DeleteUser(sessionId, userId); if (response.IsSuccesfull) { Console.Writeline("User deleted"); } else { Console.Writeline("User deletion failed"); } }

SOAP to REST Mapping

This section covers SOAP to REST migration and mapping of our legacy SOAP based SDK to the new REST APIs. It is recommended to use this reference only once CxSAST V8.8.0 is installed.

DeleteUser

For future release

For more mapping information, refer to API Mapping (SOAP to REST). You can also find a summary of our REST APIs here.

GetAllUsers Method

CxSDKWebService.GetAllUsers Method

public CxWSResponseUserData GetAllUsers
(string sessionID
);

Parameters

Return Value

CxWSResponseUserData, which includes:

UserDataList: AN array that contains all visible users.

Example

To get the list of all visible users:

internal void Main(string [] args)
{
String sessionID = args[0];
CxSDKWebService cxSDKProxy = new CxSDKWebService();
 
      CxWSResponseGroupList response =                       
           cxSDKProxy.GetAllUsers(sessionId);
UserData[] users = response.UserDataList;
}

SOAP to REST Mapping

This section covers SOAP to REST migration and mapping of our legacy SOAP based SDK to the new REST APIs. It is recommended to use this reference only once CxSAST V8.8.0 is installed.

GetAllUsers

For future release

For more mapping information, refer to API Mapping (SOAP to REST). You can also find a summary of our REST APIs here.