Adaptive OAuth
The Adaptive OAuth ai.oauth namespace for the CCDS API for obtaining a token when authenticating with Workday credentials.
ai.oauth
Functions
Method | Parameters | Return Type | Description |
---|---|---|---|
getPlanningTokenFromWorkday() Only available for customers who complete:
|
Object { authorization : string } |
Obtain a token for authenticating against planning. |
Examples
var token = ai.oauth.getPlanningTokenFromWorkday(); var body = '<?xml version="1.0" encoding="UTF-8"?><call method="customReportValues" callerName="AdaptiveInsights.Discovery">' body += '<credentials token="' + token.authorization + '" instanceCode="MYINSTANCE" /><report>...</report> </call>'; var url = 'http://api.adaptiveinsights.com/api/v22'; var method = 'POST'; var headers = { 'Content-Type': 'application/xml' }; var response = null; try { response = ai.https.request(url, method, body, headers); } catch (exception) { ai.log.logInfo('api call failed', ''+exception); return false; } ai.log.logInfo(response.getBody()); return true;