GetSessionToken Function
The GetSessionToken function returns a string that allows access to the API in place of the UserName, Password, and GroupName parameters. This token, which can be used in all Session functions, is valid for a specified number of seconds.
This parameter enables you to write programs which do not need to store user name and password information.
Syntax
The following is the syntax for an HTTP request:
POST /WindchillRiskandReliability12.0/DataEngine.asmx/GetSessionToken HTTP/1.1
Host: vm-test
Content-Type: application/x-www-form-urlencoded
Content-Length: length

UserName=string&Password=string&GroupName=string&SecondsValid=string
Parameters
The GetSessionToken function uses the login parameters for Windchill Risk and Reliability user accounts. For more information, see Login Parameters for User Accounts.
In addition, the GetSessionToken function uses this parameter:
SecondsValid—The number of seconds that the token is valid. A value of 0 returns a token that does not expire.
The following is an example of an HTTP POST request:
POST /WindchillRiskandReliability12.0/DataEngine.asmx/GetSessionToken HTTP/1.1
Host: vm-test
Content-Type: application/x-www-form-urlencoded
Content-Length: length
UserName=Bill&Password=passwd&GroupName=Manager&SecondsValid=0
Returns
If the user is authenticated, the session token is returned.
<?xml version="1.0" encoding="utf-8"?>
<DataEngineGroupListResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.ptc.com/WindchillRiskandReliability/12.0/">
<Success>true</Success>
<AdditionalData>Nlc3Npb25Ub2tlbkRhdGEgeG1sbnM9Imh0dHA9zY2hlbb250cmFjd
</AdditionalData></DataEngineGroupListResponse>
If the call fails, the AdditionalData tag provides the reason for the failure.