サイトアイコン Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Enterprise Connectorsで接続しよう!―SurveyMonkey

この記事はJim McKeethによる#ConnectTheDatayMonkey Enterprise Connector #ConnectTheDataの抄訳です。

 5月の「Enterprise Connector Spotlight」の一環として、SurveyMonkey Enterprise Connectorで何ができるかをご説明します。私たちはSurveyMonkeyを、私たちエンバカデロの社内外のアンケートで使用しています。SurveyMonkeyは無料で始められるオプションと、有料オプションを備えた、最も人気のあるアンケートプラットフォームの一つです。あなたが現在使っていなかったとしても、おそらくSurveyMonkeyのプラットフォームでアンケートに参加したことがあると思います。SurveyMonkeyの詳細は、ウェブサイトでさらに知ることができます。

それではSurveyMonkey Enterprise Connectorを使って実現できることをご紹介しましょう。Enterprise ConnectorsではSurveyMonkeyのライブデータをSQLで操作する方法を提供し、標準的な方法で容易に取り扱えます。これは、FireDACのすべての機能を使用して、独自のカスタムアプリから簡単にSurveyMonkeyのライブデータにアクセスできることを意味します。
SurveyMonkeyの利用を開始するために、CDataのWebサイトからトライアル版または製品版をダウンロードし、ガイドに従って接続してください。またSurveyMonkey Developer Portalよりclient IDとSecret APIキーを取得します。callback URLとScopeも必ず設定してください。その後、FireDAC の TFDConnection で SurveyMonkey に接続するための設定を行います。

SurveyMonkey Developer Portalでアプリを設定します。


OAuthリダイレクトURLを必ず指定してください


必要なScopeを設定してください。デフォルトでは下記の項目が必要です。
View Users, View Surveys, View Responses, View Response Details, View Contacts, and View Collectors.


CallbackURL、InitiateOAuth、OAuthClientId、OAuthClientSecretを設定します。また、必要に応じて RTK(Run-Time Key)やその他のパラメータも設定します

CDataのWebサイトにある資料をご覧ください。データモデルの項目には、Enterprise Connectorで利用できるビューの一覧があります。認証に使用されるストアドプロシージャの情報もあります。

SurveyMonkey コネクタ(2019版)で利用可能なビュー

名称 内容
CollectorMessages Shows information regarding messages sent from a collector.
CollectorRecipients Shows information regarding recipients of all or specific messages sent from a collector.
Collectors Shows collector information.
CollectorStats Shows statistics regarding all or specific messages sent from a collector.
ContactLists Shows contact list information.
Contacts Shows contact information.
Pages Shows information regarding pages for a survey.
RollupQuestions Shows rolled up individual stats information for a survey.
Rollups Shows rolled up stats information for a survey.
SurveyQuestions Shows the available columns for Survey Questions. Append _Questions to your survey name to query survey questions.
SurveyResponses Shows the available columns for Survey Responses. Append _Responses to your survey name to query survey responses.

それぞれのビューでどのようなデータが利用できるかを知ることができます。SurveyQuestionsとSurveyResponsesは直接のビューとしては存在していないことに注意してください。代わりに、調査名を明示してこれらのテーブルを参照します。

例:

[crayon-663a901b4327b514170070/]

すべての調査とそれぞれの表のリストは次のようなコードで取得できます。

[crayon-663a901b43280336082794/]

後はC++BuilderまたはDelphiアプリケーションでSurveyMonkeyデータにアクセスするだけです。有効なアップデートサブスクリプション期間中のお客様は無料のWebセミナーにご登録いただくと Enterprise Connectors Survey Monkey Componentの無料のライセンスキーを取得できます。

モバイルバージョンを終了