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
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 function#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);

Revision as of 22:35, 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:
String sessionID = Functions.getEnv(ENV.SESSION.ID);
Programmatic login
Use the code from the Sample Login Client to programmatically log in and obtain the session ID from the response.