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 with .
- Workday SAML SSO into .
- ThePublic API setuptask in Workday within thePublic APItab of the tab 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 = 'http://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.getBody()); return true; }