How to register a new user and assign the new user a role using the API?
The information in this article applies to:
- AgilePoint Suite
- AgilePoint Developer
- AgilePoint Server
| GOAL(S) |
| |
Use Web Service API to register a new user and add a role to the user programmatically. |
| |
|
| SUMMARY |
| |
APIs of RegisterUser and AddRoleMember can be used respectively. Please see details below. |
| |
|
| SOLUTION |
| |
The following is a sample code snippet that registers a user into AgilePoint as well as adding the user into a Role as a role member.
AdminService adm = new AdminService(this.textBoxAPUrl.Text);
adm.CookieContainer = new System.Net.CookieContainer();
adm.Credentials = System.Net.CredentialCache.DefaultCredentials;
RegisteredUser newuser = new RegisteredUser("virtual\\pm2", "virtual@ascentn.com", DateTime.Now, "Virtual User");
adm.RegisterUser(newuser);
adm.AddRoleMember("QA", "virtual\\pm2", "User", "", null, null);
As you can see in the code snippet, RegisterUser api is used to register a user into AgilePoint and AddRoleMember api is used to add a registered user into a Role. |
| |
|