getSecurityToken()
web-method used to get a security token which will be needed to execute all subsequent calls to SageBridge API.
Call example:
//
string result = getSecurityToken(
string userId,
string password,
string instanceId,
string outputFormat);
//
Input parameters:
| userId | (string) | (required) | Login name associated with your license |
| password | (string) | (required) | Password to acess SageBridge API |
| instanceId | (string) | (required) | Unique value to identify your application instance. Every instance shall provide a unique value. (used for tracking and testing purposes only) |
| outputFormat | (string) | (optional) | Defines a serialization method for APIResponse. Possible values: "XML", "JSON" |
Notes:
- Every unused token will expire after an amount of time defined in license.
- Every subsequent call to SageBridge API will extend token life by the same amount of time. The default value is 15 minutes.
- Any application may get as many tokens as needed.
- If you do not expect your application to make any calls for longer then tokenlife but you want to keep the token valid, please call keepTokenAlive() web-method. It will extend token life for an additional 15 minutes
- To invalidate previously issued token(s) please call invalidateToken() web-method. This call is not required but is a recommended security best practice at an end of your session.
Output:
XML or JSON string representing APIResponse structure . Payload value represents Security Token string.
XML output example:
JSON output example:
{
"result":{"value":"0", "description":"New token issued"},
"request":"getSecurityToken",
"apiInfo":{"version":"1.2.1234.5678", "protocolVersion":"2.1", "licenseExpire":"12/31/2015 23:59:59", "serverLocalTime":"01/01/2015 18:24:06"},
"transactionId":"4002cd00-db65-4a08-8e4c-a96cf4800f31",
"payload":"cf389659-588c-4fd9-ab9e-7c37b438905c"
}
payload element contains generated security token:"cf389659-588c-4fd9-ab9e-7c37b438905c"
Possible return codes
- 0 - Success. Description may vary by function
- -1 - General error. Description attribute will show more details about an error
- -2 - Function is not supported
- 500 - Invalid credentials provided
- 501 - License is expired
- 502 - License is not active
- 503 - Token is not active or expired
- 550 - Unknow functionName or not subscribed
- 551 - Unknown practice
- 552 - No Subscription found
- 553 - Subscription is inactive or expired
- 600 - Invalid or empty request parameters
- 601 - No valid route found for this subscription
- 602 - Unable to parse request parameters
Notes:
None
See Also:
keepTokenAlive() ,
invalidateToken() ,
APIResponse data