ai.oauth
Functions
Method | Parameters | Returns | Description |
|---|---|---|---|
getPlanningTokenFromWorkday() | None | Return Type: Object { authorization : string } | Obtain a token for authenticating against planning. |
Availability: Only available for customers who complete:
- Pairing their Workday tenant withAdaptive Planning.
- Workday SAML SSO intoAdaptive Planning.
- ThePublic API setuptask in Workday within thePublic APItab of theAdaptive Planningtab in Workday.
To pair your Workday tenant with Adaptive Planning and to set up SAML SSO, you must work with a Workday-certified implementer. If you don't have access to an implementer, contact your Customer Success Manager to engage professional services.
Some links in this article go to the Workday community. If you don't have a community account, request one.
Example
function testConnection(context) { var token = ai.oauth.getPlanningTokenFromWorkday(); var body = '<?xml version="1.0" encoding="UTF-8"?><call method="customReportValues" callerName="AdaptivePlanning.Discovery">' body += '<credentials token="' + token.authorization + '" instanceCode="MYINSTANCE" /><report>...</report> </call>'; var url = 'https://api.adaptiveplanning.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:",response.getBody()); return true; }