建立從 Oracle Analytics Cloud 到資料來源 REST 端點的連線之前,請建立包含連線詳細資訊的壓縮 JSON 檔案。
您可以從 Oracle Analytics Public Library 下載 JSON 範本。根據範本將連線詳細資訊儲存在 JSON 檔案中,然後以 ZIP 格式壓縮 JSON 檔案。您也可以下載各種 SaaS 和 PaaS 應用程式的範例 JSON 檔案。
連線至 REST 端點的 JSON 範本格式
{
"name": "Connection name",
"description": "Brief description",
"baseURL": "URL, e.g. https://api.surveymonkey.com/v3",
"endpoints": {
"Endpoint 1": "Endpoint 1 URL, e.g. https://api.surveymonkey.com/v3/users/endpoint1",
"Endpoint 2": "Endpoint 2 URL, e.g. https://api.surveymonkey.com/v3/question_bank/endpoint2",
"Endpoint n": "Endpoint n URL, e.g. https://api.surveymonkey.com/v3/users/endpointn"
},
"authentication": {
"type": "Authentication type"
}
}連線至 Survey Monkey REST 端點的 JSON 範例
{
"name": "Survey Monkey Connection",
"description": "Survey Monkey connection",
"baseURL": "https://api.surveymonkey.com/v3",
"endpoints": {
"Users": "https://api.surveymonkey.com/v3/users/me",
"Questions": "https://api.surveymonkey.com/v3/question_bank/questions"
},
"authentication": {
"type": "HttpHeader"
}
}關於 OAuth2 認證
開始之前,請確認您的目標資料來源支援 OAuth2 認證;並非所有資料來源都支援 OAuth2。
使用其中一個可下載範本建立 JSON 檔案時,請在 authentication-type 欄位指定適當的認證類型。
| OAuth2 類型 | authentication-type 欄位的有效值。 |
| OAuth2 代碼 | OAuth2Code |
| OAuth2 密碼證明資料 | OAUTH2PasswordGrant |
| OAuth2 隱含 | OAUTH2ImplicitGrant |
| OAuth2 從屬端證明資料 | OAUTH2ClientCredentials |
在此範例中,指定「OAuth2 密碼證明資料」認證方法,使用 "OAUTH2PasswordGrant" 作為 authentication-type 值。

.png
建立 JSON 檔案的其他秘訣