Returns the email address of the user by the user ID.
Parameters
The operation uses the following parameters:
AuthenticationData : AuthenticationData, required
An AuthenticationData
object containing the login information for QAComplete.
UserId : integer, required
The ID of the user whose email address you want to get.
Result
A string containing the email address of the address, or an empty string if there is no such user.
Example
Sample Code
C#
string login = "[email protected]";
string password = "p@ssword";
// The user ID whose email you want to get
int userId = 25310;
ServiceSoapClient service = new ServiceSoapClient();
// Preparing AuthenticationData
LoginInfo loginInfo = service.GetLoginInfo("", login, password);
AuthenticationData authData = new AuthenticationData();
authData.AppCode = loginInfo.AppCode;
authData.UserId = loginInfo.UserId;
authData.ProjId = loginInfo.ProjId;
authData.DeptId = loginInfo.DeptId;
authData.PassCode = password;
// Get the user's email
string email = service.User_GetEmailById(authData, userId);
Console.WriteLine(email);
Java
String login = "[email protected]";
String password = "p@ssword";
// The user ID whose e-mail you want to get
int userId = 25310;
ServiceSoap service = new Service().getServiceSoap12();
// Preparing AuthenticationData
LoginInfo loginInfo = service.getLoginInfo("", login, password);
AuthenticationData authData = new AuthenticationData();
authData.setAppCode(loginInfo.getAppCode());
authData.setUserId(loginInfo.getUserId());
authData.setPassCode(password);
authData.setDeptId(loginInfo.getDeptId());
authData.setProjId(loginInfo.getProjId());
// Get the user's email
String email = service.userGetEmailById(authData, userId);
System.out.println(email);
Sample Request XML
POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 500 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/User_GetEmailById"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<User_GetEmailById xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
<AppCode>agSP</AppCode>
<DeptId>7154</DeptId>
<ProjId>1032</ProjId>
<UserId>25315</UserId>
<PassCode>p@ssword</PassCode>
</AuthenticationData>
<UserId>25310</UserId>
</User_GetEmailById>
</soap:Body>
</soap:Envelope>
SOAP 1.2
POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 508 {Insert an appropriate value here}
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<User_GetEmailById xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
<AppCode>agSP</AppCode>
<DeptId>7154</DeptId>
<ProjId>1032</ProjId>
<UserId>25315</UserId>
<PassCode>p@ssword</PassCode>
</AuthenticationData>
<UserId>25310</UserId>
</User_GetEmailById>
</soap12:Body>
</soap12:Envelope>
Sample Response XML
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 408 {The server returns an appropriate value here}
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<User_GetEmailByIdResponse xmlns="http://www.pragmaticsw.com/">
<User_GetEmailByIdResult>[email protected]</User_GetEmailByIdResult>
</User_GetEmailByIdResponse>
</soap:Body>
</soap:Envelope>
SOAP 1.2
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 418 {The server returns an appropriate value here}
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<User_GetEmailByIdResponse xmlns="http://www.pragmaticsw.com/">
<User_GetEmailByIdResult>[email protected]</User_GetEmailByIdResult>
</User_GetEmailByIdResponse>
</soap12:Body>
</soap12:Envelope>
See Also
User_Add
User_GetIdByEmail
GetLoginInfo
GetLoginInfoByEntity
Users Operations
SOAP API Reference