Difference between revisions of "REST API:Obtain a Session ID"

From AgileApps Support Wiki
imported>Aeric
m (Text replace - ' getEnv(' to ' Functions.getEnv(')
imported>Aeric
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:


:;Use the getEnv from with the platform:
:;Use the getEnv from with the platform:
:: For methods running inside the platform, use the Java [[Utility_Calls#getEnv|getEnv()]] method to obtain the session ID:
:: For methods running inside the platform, use the Java [[Java API:Utility functions#getEnv|getEnv()]] method to obtain the session ID:
:::<syntaxhighlight lang="java" enclose="div">
:::<syntaxhighlight lang="java" enclose="div">
String sessionID = Functions.getEnv(ENV.SESSION.ID);
String sessionID = Functions.getEnv(ENV.SESSION.ID);

Latest revision as of 22:36, 21 August 2013

To obtain a session ID for use in making a REST request, there are a couple of options:

Use the getEnv from with the platform
For methods running inside the platform, use the Java getEnv() method to obtain the session ID:
<syntaxhighlight lang="java" enclose="div">

String sessionID = Functions.getEnv(ENV.SESSION.ID); </syntaxhighlight>

Programmatic login
Use the code from the Sample Login Client to programmatically log in and obtain the session ID from the response.