CData API Server を介してPower BI でリアルタイムAPI のデータの可視化を作成

加藤龍彦
加藤龍彦
デジタルマーケティング
CData API Server を使用してAPI のデータの仮想データベースを作成し、Power BI でカスタムレポートを作成します。



Power BI を使えば、データを美しいビジュアルに可視化したり、重要な情報を整理してダッシュボード化できます。CData API Server と組み合わせることで、可視化やダッシュボードなどのためにAPI のデータを使用できます。この記事では、CData API Server を使用してAPI の仮想データベースを作成し、API のデータを使ったレポートをPower BI で作成する方法を説明します。

API Server の設定

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

API への接続

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

  1. API Server にログインして、「Connections」をクリックします。 データベースを追加
  2. 「接続を追加」をクリックして、データソースがAPI Server に事前にインストールされている場合は、一覧から「API」を選択します。
  3. 事前にインストールされていない場合は、「インストール済み」のチェックマークを外します。その後、一覧から「API」を検索して「コネクタをインストール」をクリックしてください。 接続を設定
  4. インストールできたら、接続設定を行っていきましょう! 接続を設定
  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 のエンドポイントを表示およびコピーできます。

Power BI からAPI のデータを取得

以下のステップを実行して、Power BI から作成したOData エンドポイントに接続します。

  1. 「Power BI Desktop」を開いて「データを取得」画面を表示します。検索ボックスに「odata」と入力すると「OData フィード」が表示されるので、これを選択して「接続」をクリックします。 ODataコネクタ
  2. 「OData フィード」の接続画面で、先ほど作成したテーブルのエンドポイントに認証トークンを付加したURLを指定します。以下の形式です。

        https:///api.rsc//@/
      

    接続できるテーブルは、API Server のhttps://<ホスティング先>/api.rstで確認できます。

    ODataコネクタ

API のデータの可視化を作成

Power BI にデータを接続したら、「フィールド」ペインのフィールドをキャンバスにドラッグすることで、レポートビューにデータを可視化できます。図表の種類と、ビジュアライズするディメンションおよびメジャーを選択します。

API のデータをPower BI で可視化

「更新」をクリックしてデータの変更をレポートに同期します。

データアプリケーションからAPI のデータへのSQL アクセス

以上で、CData API Server を使用してPower BI からAPI のデータに接続できるようになりました。これで、API のデータを複製することなく多くのデータをインポートしたり、新しい可視化やレポートを作成することができます。

オンプレミスのBI やレポート、ETL、その他のデータアプリケーションから、250を超えるSaaS、ビッグデータ、NoSQL データソース(API を含む)への直接のSQL データにアクセスするには、CData API Server のページにアクセスして無料トライアルをダウンロードしてください。

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

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

CData API Server お問い合わせ