Tableau からAPI にOData フィードとして接続する方法

加藤龍彦
加藤龍彦
デジタルマーケティング
API Server を使用して、BI ツールTableau からAPI のデータに接続する方法をわかりやすく説明します。



CData API Server は、API JDBC Driver(またはほかの250を超える ADO.NET Providers)と組み合わせることでOData Web サービスとしてAPI を提供します。この記事では、API Server を使用してBI ツールTableau にAPI への接続を提供する方法について説明します。

API Server の設定

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

API への接続

Tableau から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 のエンドポイントを表示およびコピーできます。

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

それでは、API のデータを使用した可視化を作成していきましょう。

  1. Tableau で「データ接続」を選択します。「On a server」セクションで「OData」をクリックします。

    An OData data source, in the 'On a server' section in the 'Connect to data' wizard in Tableau.
  2. 表示されるウィザードで、API Server のOData エンドポイントのURL を入力します。OData エントリのURL にアクセスするテーブルの名前を追加します。例:

            https://your-server/api.rsc/posts
          
  3. 「Use a Username and Password」オプションを選択し、API Server にアクセスできるユーザーのユーザー名とパスワードを入力します。 The URL of the OData endpoint of the API Server and the username and password (authtoken) of an API Server user.
  4. Tableau は、API Server によって公開されるテーブルメタデータを使用してディメンションカラムとメタデータカラムを検出します。

    Columns organized into dimensions and measures in Tableau.(Salesforce is shown.)
  5. API のデータを表示するには、ダッシュボードの「Data」セクションでテーブル名の下を右クリックし、「View Data」オプションを選択します。 API のデータがTableau に表示されます。

    A grid of data in Tableau.(Salesforce is shown.)

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

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

CData API Server お問い合わせ