Applies to QAComplete 12.21 SaaS, last modified on July 15, 2019

Almost all of QAComplete SOAP API operations require authentication. This ensures that only known users can access data in QAComplete.

The only operations that do not need authentication are GetVersion, GetLoginInfo and GetLoginInfoByEntity.

To authenticate, you need to pass the user ID (not the login e-mail address), password, QAComplete project ID, and department ID in the AuthenticationData object in the request body. You can find these IDs in QAComplete, or get them programmatically using QAComplete SOAP API.

The authenticating user must have the security rights in the project or area being accessed. To check user privileges in QAComplete, go to  > Setup > Security > Security Groups and click Manage Security Rights.

Currently, it is impossible to access the QAComplete SOAP API using single sign-on credentials.

View IDs in QAComplete

To view the necessary IDs in QAComplete:

  1. In QAComplete, go to  > Setup. If it is already open, select another tab and then go back to  > Setup.

  2. Check the AppCode value.

    AppCode in QAComplete
  3. From the tree on the left, select Projects (Open & Create).

  4. Click Choose Fields on the toolbar above the project list.

  5. Add ID and Dept ID from the Available Fields list to the Chosen Fields list, and click Submit Changes.

    Now, the project list shows the project IDs and department IDs.

    The project and department IDs

    Click the image to enlarge it.

  6. From the tree on the left, select Security > Users.

  7. Click Choose Fields on the toolbar above the user list.

  8. Add UserId from the Available Fields list to the Chosen Fields list, and click Submit Changes.

    Now, the user list shows user IDs.

    User IDs

    Click the image to enlarge it.

Get IDs with SOAP API

First, call GetLoginInfo with your login email and password as parameters. You will get a LoginInfo object with the user ID, last used project ID, department ID, and a list of projects the user can access.

C#

ServiceSoapClient service = new ServiceSoapClient();

string login = "john.doe@example.com";
string password = "p@ssword";
LoginInfo loginInfo = service.GetLoginInfo("", login, password);

Java

ServiceSoap service = new Service().getServiceSoap12();

String login = "john.doe@example.com";
String password = "p@ssword";
LoginInfo loginInfo = service.getLoginInfo("", login, password);

Then, create an AuthenticationData object and copy data from the LoginInfo object there.

C#

AuthenticationData authData = new AuthenticationData();
authData.AppCode = loginInfo.AppCode;
authData.UserId = loginInfo.UserId;
authData.ProjId = loginInfo.ProjId;
authData.DeptId = loginInfo.DeptId;
authData.PassCode = password;

Java

AuthenticationData authData = new AuthenticationData();
authData.setAppCode(loginInfo.getAppCode());
authData.setUserId(loginInfo.getUserId());
authData.setProjId(loginInfo.getProjId());
authData.setDeptId(loginInfo.getDeptId());
authData.setPassCode(password);

If the authenticating user is on several projects and you want to access data in all these projects, you need to copy the project IDs from LoginInfo.Projects to AuthenticationData.ProjIds.

C#

authData.ProjIds = new ArrayOfInt();
authData.ProjIds.Capacity = loginInfo.Projects.Length;
foreach (Project proj in loginInfo.Projects)
{
  authData.ProjIds.Add(proj.ProjId);
}

Java

ArrayOfInt projIds = new ArrayOfInt();
for (Project proj : loginInfo.getProjects().getProject()) {
  projIds.getInt().add(proj.getProjId());
}
authData.setProjIds(projIds);

In .NET applications for .NET Framework 3.5 or later, you can also fill AuthenticationData.ProjIds using LINQ:

C#

using System.Linq;
...

authData.ProjIds = new ArrayOfInt();
authData.ProjIds.AddRange(loginInfo.Projects.Select(x => x.ProjId));

Now, you can use the created AuthenticationData object as a parameter to web service operations that need authentication. For example:

C#

int anotherUserId = service.User_GetIdByEmail(authData, "another.user@example.com");

Java

int anotherUserId = service.userGetIdByEmail(authData, "another.user@example.com");

See Also

SOAP API Introduction
GetLoginInfo
AuthenticationData Object

Highlight search results