GetLoginInfo Operation

Applies to QAComplete 14.5, last modified on August 06, 2024

Given a user’s email and password, returns the user ID, department ID and the projects the user has access to. You need this information to authenticate requests made to the QAComplete SOAP API.

Parameters

The operation uses the following parameters:

AppCode  :  string

For QAComplete SaaS (hosted on qacomplete.smartbear.com), use agSP.

For QAComplete On-Premises (hosted on your company-owned server), this is typically agSPEnt.

You can see the needed AppCode value on the Setup tab in QAComplete.

Email  :  string, required

The user’s email address.

Password  :  string, required

The user’s password.

Result

A LoginInfo object that contains the user ID, department ID and the projects the user has access to.

Example

Sample Code

C#

string login = "[email protected]";
string password = "p@ssword";

ServiceSoapClient service = new ServiceSoapClient();
LoginInfo loginInfo = service.GetLoginInfo("", login, password);

Console.WriteLine("UserId: {0}", loginInfo.UserId);
Console.WriteLine("The user has access to projects:");
foreach (Project proj in loginInfo.Projects)
{
    Console.WriteLine("\t{0} {1} (department: {2} {3})",
                      proj.ProjId, proj.ProjName, proj.DeptId, proj.DeptName);
}
Console.WriteLine("Last used project: {0}", loginInfo.ProjId);

Java

String login = "[email protected]";
String password = "p@ssword";

ServiceSoap service = new Service().getServiceSoap12();
LoginInfo loginInfo = service.getLoginInfo("", login, password);

System.out.format("UserId: %d%n", loginInfo.getUserId());
System.out.println("The user has access to projects:");
for (Project proj : loginInfo.getProjects().getProject()) {
    System.out.format("\t%d %s (department: %d %s)%n", proj.getProjId(), proj.getProjName(), proj.getDeptId(), proj.getDeptName());
}
System.out.format("Last used project: %d%n", loginInfo.getProjId());

Sample Request XML

POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 398 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/GetLoginInfo"
 

<?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>
    <GetLoginInfo xmlns="http://www.pragmaticsw.com/">
      <AppCode>agSP</AppCode>
      <Email>[email protected]</Email>
      <Password>p@ssword</Password>
    </GetLoginInfo>
  </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: 406 {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>
    <GetLoginInfo xmlns="http://www.pragmaticsw.com/">
      <AppCode>agSP</AppCode>
      <Email>[email protected]</Email>
      <Password>p@ssword</Password>
    </GetLoginInfo>
  </soap12:Body>
</soap12:Envelope>

Sample Response XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 737 {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>
    <GetLoginInfoResponse xmlns="http://www.pragmaticsw.com/">
      <GetLoginInfoResult>
        <UserId>24661</UserId>
        <AppCode>agSP</AppCode>
        <ProjId>10372</ProjId>
        <DeptId>7154</DeptId>
        <Projects>
          <Project>
            <DeptId>7154</DeptId>
            <DeptName>Edgar Solutions</DeptName>
            <ProjId>10372</ProjId>
            <ProjName>FamilyAlbum</ProjName>
          </Project>
          <Project>
            <DeptId>7154</DeptId>
            <DeptName>Edgar Solutions</DeptName>
            <ProjId>10369</ProjId>
            <ProjName>ScreenSaver</ProjName>
          </Project>
        </Projects>
      </GetLoginInfoResult>
    </GetLoginInfoResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 747 {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>
    <GetLoginInfoResponse xmlns="http://www.pragmaticsw.com/">
      <GetLoginInfoResult>
        <UserId>24661</UserId>
        <AppCode>agSP</AppCode>
        <ProjId>10372</ProjId>
        <DeptId>7154</DeptId>
        <Projects>
          <Project>
            <DeptId>7154</DeptId>
            <DeptName>Edgar Solutions</DeptName>
            <ProjId>10372</ProjId>
            <ProjName>FamilyAlbum</ProjName>
          </Project>
          <Project>
            <DeptId>7154</DeptId>
            <DeptName>Edgar Solutions</DeptName>
            <ProjId>10369</ProjId>
            <ProjName>ScreenSaver</ProjName>
          </Project>
        </Projects>
      </GetLoginInfoResult>
    </GetLoginInfoResponse>
  </soap12:Body>
</soap12:Envelope>

See Also

Users Operations
GetLoginInfoByEntity
User_GetEmailById
User_GetIdByEmail

Highlight search results