【ノーコード】SAP LumiraでAPI のOData フィードを取り込んでみる

古川えりか
古川えりか
コンテンツスペシャリスト
SAP Lumira × API連携の複雑なAPI開発をCData API Serverでノーコード解決。ODataフィードの自動生成でSAP Lumira からのBI分析を簡単に実現、データドリブン意思決定を加速します。



CData API Server を使って、SAP Lumira でAPI に基づくビジュアライゼーションを作成できます。API Server により、リアルタイムデータへの接続が可能になります。ダッシュボードとレポートはオンデマンドで更新できます。この記事では、常に最新であるグラフを作成する方法を説明します。

API Server の設定

以下のリンクからAPI Server の無償トライアルをスタートしたら、セキュアなAPI OData サービスを作成していきましょう。

API への接続

Salesforce Connect からAPI のデータを操作するには、まずyour API への接続を作成・設定します。

  1. API Server にログインして、「Connections」をクリック、さらに「接続を追加」をクリックします。 接続を追加
  2. 「接続を追加」をクリックして、データソースがAPI Server に事前にインストールされている場合は、一覧から「API」を選択します。
  3. 事前にインストールされていない場合は、コネクタを追加していきます。コネクタ追加の手順は以下の記事にまとめてありますので、ご確認ください。
    CData コネクタの追加方法はこちら >>
  4. それでは、API への接続設定を行っていきましょう! 接続設定
  5. To connect to your API, configure the following properties on the Global Settings page:

    • In Authentication, select the Type and fill in the required properties
    • In Headers, add the required HTTP headers for your API
    • In Pagination, select the Type and fill in the required properties

    After the configuring the global settings, navigate to the Tables to add tables. For each table you wish to add:

    1. Click "+ Add"
    2. Set the Name for the table
    3. Set Request URL to the API endpoint you wish to work with
    4. (Optional) In Parameters, add the required URL Parameters for your API endpoint
    5. (Optional) In Headers, add the required HTTP headers for the API endpoint
    6. In Table Data click " Configure"
    7. Review the response from the API and click "Next"
    8. Select which element to use as the Repeated Elements and which elements to use as Columns and click "Next"
    9. Preview the tabular model of the API response and click "Confirm"
  6. 接続情報の入力が完了したら、「保存およびテスト」をクリックします。

To connect to your API, configure the following properties on the Global Settings page:

  • In Authentication, select the Type and fill in the required properties
  • In Headers, add the required HTTP headers for your API
  • In Pagination, select the Type and fill in the required properties

After the configuring the global settings, navigate to the Tables to add tables. For each table you wish to add:

  1. Click "+ Add"
  2. Set the Name for the table
  3. Set Request URL to the API endpoint you wish to work with
  4. (Optional) In Parameters, add the required URL Parameters for your API endpoint
  5. (Optional) In Headers, add the required HTTP headers for the API endpoint
  6. In Table Data click " Configure"
  7. Review the response from the API and click "Next"
  8. Select which element to use as the Repeated Elements and which elements to use as Columns and click "Next"
  9. Preview the tabular model of the API response and click "Confirm"

API Server のユーザー設定

次に、API Server 経由でAPI にアクセスするユーザーを作成します。「Users」ページでユーザーを追加・設定できます。やってみましょう。

  1. 「Users」ページで ユーザーを追加をクリックすると、「ユーザーを追加」ポップアップが開きます。
  2. 次に、「ロール」、「ユーザー名」、「権限」プロパティを設定し、「ユーザーを追加」をクリックします。
  3. その後、ユーザーの認証トークンが生成されます。各ユーザーの認証トークンとその他の情報は「Users」ページで確認できます。

API 用のAPI エンドポイントの作成

ユーザーを作成したら、API のデータ用のAPI エンドポイントを作成していきます。

  1. まず、「API」ページに移動し、 「 テーブルを追加」をクリックします。
  2. アクセスしたい接続を選択し、次へをクリックします。
  3. 接続を選択した状態で、各テーブルを選択して確認をクリックすることでエンドポイントを作成します。

OData のエンドポイントを取得

以上でAPI への接続を設定してユーザーを作成し、API Server でAPI データのAPI を追加しました。これで、OData 形式のAPI データをREST API で利用できます。API Server の「API」ページから、API のエンドポイントを表示およびコピーできます。

SAP Lumira からAPI への接続

以下のステップに従って、API をSAP Lumira に取得します。SQL クエリを実行するか、UI を使用できます。

  1. SAP Lumira で[File]->[New]->[Query with SQL]とクリックします。Add New Dataset ダイアログが表示されます。
  2. [Generic]セクションを展開し、[Generic OData 2.0 Connector]オプションをクリックします。
  3. [Service Root URI]ボックスに、API Server のOData エンドポイントを入力します。URL は次の例のようになります。
    https://your-server:8032/api.rsc
    
  4. [User Name]と[Password]のボックスにAPI ユーザーのユーザー名と認証トークンを入力します。これらの資格情報は、HTTP 基本認証で使用されます。 The OData endpoint and HTTP Basic authentication configured for an API user.
  5. ツリーでエンティティを選択するか、SQL クエリを入力します。この記事では、API posts エンティティをインポートします。

    Available entities for import.(Salesforce is shown.)
  6. [Connect]をクリックすると、SAP Lumira は対応するOData 要求を生成し、結果をメモリにロードします。その後、フィルタ、集計、要約関数など、SAP Lumira で使用可能な任意のデータ処理ツールを使用できます。

    Tables ofAPI のデータto be imported into SAP Lumira.(Salesforce Accounts are shown.)

データのビジュアライゼーションを作成

データをインポートした後、[Visualize]ルームでデータのビジュアライゼーションを作成できます。以下のステップに従って、基本グラフを作成します。

  1. [Measures and Dimensions]ペインで、メジャーとディメンションを[Visualization Tools]ペインの[x-axis]フィールドと[y-axis]フィールドにドラッグします。SAP Lumira は、API Server のメタデータサービスからディメンションとメジャーを自動的に検出します。

    デフォルトでは、SUM 関数はすべてのメジャーに適用されます。メジャーの横にある歯車のアイコンをクリックしてデフォルトの要約を変更します。

  2. [Visualization Tools]ペインで、グラフの種類を選択します。
  3. [Chart Canvas]ペインで、フィルタを適用し、メジャーで並べ替え、ランキングを追加して現在のAPI でグラフを更新します。 A basic line chart.(Salesforce is shown.)

はじめる準備はできましたか?

詳細はこちら、または無料トライアルにお申し込みください:

CData API Server お問い合わせ