ai.oauth
函數
方法 | 參數 | 退貨 | 說明 |
|---|---|---|---|
getPlanningTokenFromWorkday() | 無 | 傳回類型︰Object { authorization : string } | 取得依據 Planning 進行驗證的權杖。 |
可用性︰僅適用於完成以下項目的客戶︰
- 將 Workday 用戶配對至Adaptive Planning。
- Workday SAML SSO 轉換為Adaptive Planning。
- Workday 中「公開 API 設定」任務的「公開 API」分頁Adaptive PlanningWorkday 中的分頁
要將 Workday 用戶與 Adaptive Planning 配對並設定 SAML SSO,您必須與 Workday 認證的實行者合作。如果您無法聯繫到實行者,請聯絡客戶成功經理,以取得專業服務。
本文中的某些連結會指向 Workday Community。如果您沒有社區帳戶, 請申請一個。
範例
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; }