【ノーコード】RunMyProcess からAPI Server 経由でAPI のデータと連携

桑島義行
桑島義行
テクニカルディレクター
RunMyProcessでのAPIデータ活用でお困りですか?CData API ServerでOData作成、業務プロセスへのリアルタイムデータ連携が5分で完了。無償トライアルですぐにスタート。



Akorbi Digital RunMyProcess を使えば、予算申請や契約管理など複雑なビジネスプロセスをノーコードでアプリ化できます。CData API Server はAPI の仮想データベースを作成して、API のOData API(RunMyProcess でネイティブに使用可能)を生成するために使用します。RunMyProcess をCData API Server と連携することで、対応するすべてのSaaS、Big Data、およびNoSQL ソースへ接続でき、API のデータに素早くアクセスできます。

この記事では、二つのステップでAPI のデータへの接続方法を説明します。

  1. API Server からAPI への接続
  2. RunMyProcess からAPI Server に接続してAPI のデータを取得

API Server の設定

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

API への接続

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

(オプション)Cross-Origin Resource Sharing (CORS) を構成

Ajax などのアプリケーションから複数のドメインにアクセスして接続すると、クロスサイトスクリプティングの制限に違反する恐れがあります。その場合には、[OData]->[Settings]でCORS 設定を構成します。

  • Enable cross-origin resource sharing (CORS):ON
  • Allow all domains without '*':ON
  • Access-Control-Allow-Methods:GET, PUT, POST, OPTIONS
  • Access-Control-Allow-Headers:Authorization

設定への変更を保存します。

Configuring CORS settings

RunMyProcess DigitalSuite Studio からAPI のデータにアクセス

API への接続とOData エンドポイントがあれば、RunMyProcess からAPI のデータにアクセスできます。

Provider の作成

  1. RunMyProcess にログインして、「DigitalSuite Studio」を開きます。
  2. 「Resources」をクリックしてリソースページを表示したら、「CONNECTORS」タブを選択すると次のような画面が表示されます。 リソースのConnectors タブ
  3. 「+」(New Provider)ボタンをクリックすると新規プロバイダー作成用の画面が表示されるので、リソースを使用するプロジェクトを選択して、「Confirm」ボタンをクリックします。 新規プロバイダーの作成
  4. プロバイダーの設定画面が表示されるので、次の情報を入力します。
    • URL:API Server の「API」ページにある、次のOData エンドポイントを指定します。https://myserver/api.rsc/
    • Authentication Schema:「Login/Password」を指定します。
    • Login:設定したAPI Server のユーザー名を指定します。
    • Password:上記のユーザー用のAuthtoken に設定します。
    Selecting a connector
  5. 「ACCEPTANCE」、「TEST」タブにも同じ情報を入力します。Note:その際、右上の「Copy this configuration」ボタンをクリックすることで設定をコピーでき、コピー先のタブで「Paste previously copied configuration」ボタンをクリックすることで既存の設定を反映できます。
  6. 完了したら、「Save」をクリックして保存します。

Connector を作成してAPI のデータを取得

  1. 次に「CONNECTORS」タブから、作成したプロバイダーの右端のボタンをクリックして、メニューから「Add connector」を選択します。
  2. 次のような画面が表示されるので、「Connector URL」にAPI Server で設定したテーブルのOData エンドポイントを指定します。例:odataendpoint/ コネクタの設定画面
  3. 入力したら右上の「Save」ボタンをクリックしたあと、「Launch」ボタンをクリックしてコネクタのテスト実行用の画面を開き、右上の「Launch test」ボタンをクリックして実行します。次のように、指定したテーブルの情報がJSON で返ってくれば成功です。 実行テスト画面

詳細と無料トライアル

これで、RunMyProcess からAPI のデータに接続できました。API や、その他250以上のデータソースのOData フィードを作成する方法は、API Server ページ を参照してください。無料トライアルにサインアップして、RunMyProcess からAPI のデータに連携してアプリを作成しましょう。

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

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

CData API Server お問い合わせ