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

From AgileApps Support Wiki
imported>Aeric
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 [[Java API:Utility function#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:
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.