次の例は Salesforce CDP Connector を使用してさまざまな Salesforce CDP API エンドポイントを統合する方法を示しています。
-
ストリーミング API 取り込みのフローは次のとおりです。
-
[Insert Data - Streaming API]
ストリーミング API を介してオブジェクトのエンドポイントにデータを挿入する方法を示します。 -
[Delete Data - Streaming API]
ストリーミング API を介して特定のオブジェクトのレコードを削除する方法を示します。
-
-
Bulk API 取り込みのフローは次のとおりです。
-
[Create Job - Bulk API]
Salesforce CDP 取り込み API オブジェクトにデータをアップロードするために必要な一括ジョブを作成する方法を示します。 -
[Upload Job Data - Bulk API]
Salesforce CDP 取り込み API オブジェクトに挿入するデータ、または Salesforce CDP 取り込み API オブジェクトから削除するデータをアップロードする方法を示します。 -
[Close Job - Bulk API]
指定したジョブ ID の状況を更新し、ジョブを終了して処理キューに登録する方法を示します。 -
[Abort Job - Bulk API]
指定したジョブ ID の状況を更新し、ジョブを中止して処理キューには登録しないようにする方法を示します。 -
[Get Job - Bulk API]
指定したジョブ ID の現在の状況を取得する方法を示します。 -
[Delete Job - Bulk API]
指定したジョブ ID を削除または終了する方法を示します。これにより、Salesforce で保存されているジョブデータとメタデータが削除されます。
-
-
クエリ API のフローは次のとおりです。
-
[Query API]
データモデルオブジェクト、レークオブジェクト、統合オブジェクト、リンクオブジェクトにわたって Salesforce CDP データレークを照会する方法を示します。
-
-
計算済みインサイト API のフローは次のとおりです。
-
[Insights - List Metadata API]
すべての計算済みインサイトのディメンションと基準などのメタデータを取得する方法を示します。 -
[Insights - Get Metadata API]
計算済みインサイトのディメンションと基準などのメタデータを取得する方法を示します。 -
[Insights - Get Insights API]
計算済みインサイトを照会する方法を示します。ユーザーはさまざまなディメンション、基準、検索条件を選択することによって、分析や絞り込みを行うことができます。
-
-
Profile API のフローは次のとおりです。
-
[Profile - List Metadata API]
すべてのデータモデルオブジェクトのメタデータを取得する方法を示します。 -
[Profile - Get Metadata API]
要求されたデータモデルオブジェクトのメタデータを取得する方法を示します。 -
[Profile - Search Records API]
検索条件に基づいてデータモデルオブジェクトレコードを取得する方法を示します。 -
[Profile - Search Records By ID API]
インデックスと検索条件に基づいてデータモデルオブジェクトレコードを取得する方法を示します。 -
[Profile - Search Records With Child Records API]
インデックスと検索条件に基づいてデータモデルオブジェクトレコードと子オブジェクトレコードを取得する方法を示します。 -
[Profile - Search Records With Insight API]
インデックスと検索条件に基づいてデータモデルオブジェクトレコードと計算済みビューを取得する方法を示します。
-
-
データアクション API のフローは次のとおりです。
-
[Data Action Webhook]
データアクションがトリガーされたときに操作を実行する方法を示します。
-
データの挿入 - ストリーミング API
この Mule フローでは、ストリーミング API を介してオブジェクトのエンドポイントにデータを挿入する方法を示します。 Salesforce API のドキュメントを参照してください。
この例では、次の操作を使用します。
-
HTTP Listener
ソースとオブジェクト名が URI パラメーターとして含まれる HTTP POST 要求からデータを受け取ります。 -
Logger
Listener から受け取った HTTP 要求を表示します。また、後で Insert Objects 操作からの HTTP 応答を表示します。 -
Streaming Insert
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
ソース名、オブジェクト名、ペイロードを受け取ります。
-
Salesforce API をコールして、該当のオブジェクトのエンドポイントにペイロードを挿入します。
-
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" keyAlias="${server.certificateAlias}" audienceUrl="${server.audienceUrl}"/>
</sdc:sdc-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection audienceUrl="${server.audienceUrl}" username="${server.userName}" password="${server.password}" clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}"/>
</sdc:sdc-config>
<flow name="Insert-objectsFlow" >
<http:listener doc:name="POST /insert/{sourceApiName}/{objectName}" config-ref="HTTP_Listener_config" path="/insert/{sourceApiName}/{objectName}" allowedMethods="POST"/>
<logger level="INFO" doc:name="Request Logger" message="#[payload]"/>
<sdc:insert-objects doc:name="Streaming Insert" config-ref="Salesforce_CDP_OAuth_JWT_config" sourceNameUriParam="#[attributes.uriParams.sourceApiName]" objectNameUriParam="#[attributes.uriParams.objectName]"/>
<logger level="INFO" doc:name="Response Logger" />
</flow>
</mule>
クエリ API
この Mule フローでは、カスタム SOQL クエリを使用して CDP からデータを照会する方法を示します。 Salesforce SOQL のドキュメントを参照してください。
この例では、次の操作を使用します。
-
HTTP Listener
ペイロードにクエリが含まれる HTTP POST 要求からデータを受け取ります。 -
Logger
Listener から受け取った HTTP 要求を表示します。また、後で Query 操作からの HTTP 応答を表示します。 -
クエリ
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
前の SOQL クエリを受け取ります。
-
クエリを含む Salesforce API をコールして、結果を受け取ります。
-
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" keyAlias="${server.certificateAlias}" audienceUrl="${server.audienceUrl}"/>
</sdc:sdc-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection audienceUrl="${server.audienceUrl}" username="${server.userName}" password="${server.password}" clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}"/>
</sdc:sdc-config>
<flow name="query-objectsFlow" >
<http:listener doc:name="POST /query" config-ref="HTTP_Listener_config" path="/query" allowedMethods="POST"/>
<logger level="INFO" doc:name="Request Logger" message="#[payload]"/>
<sdc:query doc:name="Query" config-ref="Salesforce_CDP_OAuth_JWT_config"/>
<logger level="INFO" doc:name="Response Logger" message="#[payload]"/>
</flow>
</mule>
データの削除 - ストリーミング API
この Mule フローでは、オブジェクトのエンドポイントを使用してストリーミング API を介してデータを削除する方法を示します。 Salesforce API のドキュメントを参照してください。
この例では、次の操作を使用します。
-
HTTP Listener
ソース API とオブジェクト名が URI パラメーターとして含まれ、レコード ID がクエリパラメーターとして含まれる HTTP DELETE 要求からデータを受け取ります。 -
Logger
Listener から受け取った HTTP 要求を表示します。また、後で Streaming Delete 操作からの HTTP 応答を表示します。 -
Streaming Delete
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
ソース API 参照名、オブジェクト名、レコード ID を受け取ります。
-
Salesforce API をコールして、該当のオブジェクトのエンドポイントを使用してクエリパラメーターからレコードを削除します。
-
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" keyAlias="${server.certificateAlias}" audienceUrl="${server.audienceUrl}"/>
</sdc:sdc-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection audienceUrl="${server.audienceUrl}" username="${server.userName}" password="${server.password}" clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}"/>
</sdc:sdc-config>
<flow name="delete-objectsFlow" >
<http:listener doc:name="DELETE /delete/{sourceApiName}/{objectName}" config-ref="HTTP_Listener_config" path="/delete/{sourceApiName}/{objectName}" allowedMethods="DELETE"/>
<logger level="INFO" doc:name="Request Logger" />
<sdc:delete-objects doc:name="Streaming - Delete Objects" config-ref="Salesforce_CDP_OAuth_JWT_config" idsQueryParams="#[output application/java --- [attributes.queryParams.ids]]" sourceNameUriParam="#[attributes.uriParams.sourceApiName]" objectNameUriParam="#[attributes.uriParams.objectName]"/>
<logger level="INFO" doc:name="Response Logger" />
</flow>
</mule>
ジョブの作成 - Bulk API
この Mule フローでは、Salesforce CDP 取り込み API オブジェクトにデータをアップロードする一括ジョブを作成する方法を示します。 Salesforce API のドキュメントを参照してください。
この例では、次の操作を使用します。
-
HTTP Listener
ソース API とオブジェクト名が URI パラメーターとして含まれ、レコード ID がクエリパラメーターとして含まれる HTTP POST 要求からデータを受け取ります。 -
Logger
Listener から受け取った HTTP 要求を表示します。また、後で Create Job 操作からの HTTP 応答を表示します。 -
Create Job:
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
ソース API 参照名、オブジェクト名、ジョブ操作を受け取ります。ジョブ操作については、「リファレンス」ページを参照してください。
-
ジョブを作成する Salesforce API をコールして、応答を返します。
-
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:salesforce="http://www.mulesoft.org/schema/mule/salesforce" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/salesforce http://www.mulesoft.org/schema/mule/salesforce/current/mule-salesforce.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" audienceUrl="${server.audienceUrl}" keyAlias="${server.certificateAlias}" />
</sdc:sdc-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}" username="${server.userName}" password="${server.password}" audienceUrl="${server.audienceUrl}" />
</sdc:sdc-config>
<flow name="CreateJob" >
<http:listener doc:name="Post /jobs/create" config-ref="HTTP_Listener_config" path="/jobs/create/{sourceApiName}/{objectName}/{operation}"/>
<sdc:create-bulk-job doc:name="Create Job" config-ref="Salesforce_CDP_OAuth_UsernamePassword_config" sourceNameUriParam="#[attributes.uriParams.sourceApiName]" objectNameUriParam="#[attributes.uriParams.objectName]" operationUriParam="#[attributes.uriParams.operation]"/>
<logger level="INFO" doc:name="Logger" />
</flow>
</mule>
ジョブデータのアップロード - Bulk API
この Mule フローでは、ジョブ ID で指定した Salesforce CDP 取り込み API オブジェクトに挿入するデータ、またはその Salesforce CDP 取り込み API オブジェクトから削除するデータをアップロードする方法を示します。 Salesforce API のドキュメントを参照してください。
この例では、次の操作を使用します。
-
HTTP Listener
URI にジョブ ID が含まれる HTTP POST 要求からデータを受け取ります。 -
CSV Reader
絶対ファイルパスで設定された CSV からデータを読み取ります。 -
Set Payload
Upload Job Data 用の CSV データでペイロードを更新します。 -
Upload Job Data
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
HTTP 要求からのジョブ ID と、ペイロードにある CSV データを受け取ります。
-
データを CSV から Salesforce CDP 取り込み API オブジェクトにアップロードし、最終的に HTTP 応答を返します。
-
-
Logger
Upload Job Data 操作からの HTTP 結果を表示します。
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:salesforce="http://www.mulesoft.org/schema/mule/salesforce" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/salesforce http://www.mulesoft.org/schema/mule/salesforce/current/mule-salesforce.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" audienceUrl="${server.audienceUrl}" keyAlias="${server.certificateAlias}" />
</sdc:sdc-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}" username="${server.userName}" password="${server.password}" audienceUrl="${server.audienceUrl}" />
</sdc:sdc-config>
<flow name="UploadJobData" >
<http:listener doc:name="Upload Job Data Listener" config-ref="HTTP_Listener_config" path="/jobs/upload/{jobId}"/>
<file:read doc:name="CSV Reader" path="" target="content"/>
<set-payload value="#[vars.content]" doc:name="Set Payload" />
<sdc:upload-data-bulk-job doc:name="Upload Job Data" config-ref="Salesforce_CDP_OAuth_JWT_config" idUriParam="#[attributes.uriParams.jobId]"/>
<logger level="INFO" doc:name="Logger" message="#[message]"/>
</flow>
</mule>
この例の実行手順
-
CSV への有効な絶対ファイルパスを CSV Reader の [File Path (ファイルパス)] 属性に入力します。
-
プロジェクトを保存します。
-
ジョブを作成し、そのジョブ ID をコピーします。
-
前の手順でコピーしたジョブ ID を使用して
POST を localhost:8081/jobs/upload/{JOB_ID} に送信し、フローをテストします。
ジョブの終了 - Bulk API
この Mule フローでは、指定したジョブ ID の状況を更新してジョブを終了する方法を示します。終了したジョブは、 Salesforce API のドキュメント処理キューに登録されます。
この例では、次の操作を使用します。
-
HTTP Listener
URI パラメーターにジョブ ID が含まれる HTTP GET 要求からデータを受け取ります。 -
Logger
Close Job 操作からの HTTP 応答を表示します。 -
Close Job
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
指定されたジョブを受け取ります。
-
UploadComplete 状態を使用して Salesforce API をコールし、該当のジョブを完了した後、HTTP 応答を受け取ります。
-
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:salesforce="http://www.mulesoft.org/schema/mule/salesforce" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/salesforce http://www.mulesoft.org/schema/mule/salesforce/current/mule-salesforce.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" audienceUrl="${server.audienceUrl}" keyAlias="${server.certificateAlias}" />
</sdc:sdc-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}" username="${server.userName}" password="${server.password}" audienceUrl="${server.audienceUrl}" />
</sdc:sdc-config>
<flow name="CloseJob" >
<http:listener doc:name="Get /jobs/close/{jobId}" config-ref="HTTP_Listener_config" path="/jobs/close/{jobId}"/>
<sdc:update-bulk-operation-job doc:name="Close Job" config-ref="Salesforce_CDP_OAuth_JWT_config" idUriParam="#[attributes.uriParams.jobId]" state="UploadComplete"/>
<logger level="INFO" doc:name="Logger" />
</flow>
</mule>
ジョブの中止 - Bulk API
この Mule フローでは、指定したジョブ ID の状況を更新してジョブを中止する方法を示します。中止したジョブは、 Salesforce API のドキュメント処理キューに登録されません。
この例では、次の操作を使用します。
-
HTTP Listener
URI パラメーターにジョブ ID が含まれる HTTP GET 要求からデータを受け取ります。 -
Logger
Abort Job 操作からの HTTP 応答を表示します。 -
Abort Job:
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
URI パラメーターとして使用されたジョブ ID を受け取ります。
-
aborted 状態を使用して Salesforce API をコールし、該当のジョブを中止した後、HTTP 応答を受け取ります。
-
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:salesforce="http://www.mulesoft.org/schema/mule/salesforce" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/salesforce http://www.mulesoft.org/schema/mule/salesforce/current/mule-salesforce.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" audienceUrl="${server.audienceUrl}" keyAlias="${server.certificateAlias}" />
</sdc:sdc-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}" username="${server.userName}" password="${server.password}" audienceUrl="${server.audienceUrl}" />
</sdc:sdc-config>
<flow name="AbortJob" >
<http:listener doc:name="Get /jobs/abort/{jobId}" config-ref="HTTP_Listener_config" path="/jobs/abort/{jobId}"/>
<sdc:update-bulk-operation-job doc:name="Abort Job" config-ref="Salesforce_CDP_OAuth_JWT_config" idUriParam="#[attributes.uriParams.jobId]" state="Aborted"/>
<logger level="INFO" doc:name="Logger" />
</flow>
</mule>
この例の実行手順
-
プロジェクトを保存します。
-
ジョブを作成し、結果のジョブ ID をコピーします。
-
前の手順でコピーしたジョブ ID を使用して
GET を localhost:8081/jobs/abort/{JOB_ID} に送信し、フローをテストします。
ジョブの取得 - Bulk API
この Mule フローでは、指定したジョブ ID の現在の状況を取得する方法を示します。 Salesforce API のドキュメントを参照してください。
この例では、次の操作を使用します。
-
HTTP Listener
URI パラメーターにジョブ ID が含まれる HTTP GET 要求からデータを受け取ります。 -
Logger
Get Job 操作からの HTTP 応答を表示します。 -
Get Job
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
URI パラメーターからジョブ ID を受け取ります。
-
Salesforce API をコールして、ジョブの状況を返します。
-
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:salesforce="http://www.mulesoft.org/schema/mule/salesforce" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/salesforce http://www.mulesoft.org/schema/mule/salesforce/current/mule-salesforce.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" audienceUrl="${server.audienceUrl}" keyAlias="${server.certificateAlias}" />
</sdc:sdc-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}" username="${server.userName}" password="${server.password}" audienceUrl="${server.audienceUrl}" />
</sdc:sdc-config>
<flow name="GetJob" >
<http:listener doc:name="Get /jobs/get/{jobId}" config-ref="HTTP_Listener_config" path="/jobs/get/{jobId}"/>
<sdc:get-bulk-job doc:name="Get Job" config-ref="Salesforce_CDP_OAuth_JWT_config" idUriParam="#[attributes.uriParams.jobId]"/>
<logger level="INFO" doc:name="Logger" />
</flow>
</mule>
この例の実行手順
-
プロジェクトを保存します。
-
ジョブを作成し、結果のジョブ ID をコピーします。
-
前の手順でコピーしたジョブ ID を使用して
GET を localhost:8081/jobs/get/{JOB_ID} に送信し、フローをテストします。
ジョブの削除 - Bulk API
この Mule フローでは、指定したジョブ ID を削除または終了する方法を示します。これにより、Salesforce で保存されているジョブデータとメタデータが削除されます。
ジョブを削除するには、そのジョブの状況が UploadComplete、JobComplete、Aborted、または Failed である必要があります。 Salesforce API のドキュメントを参照してください。
この例では、次の操作を使用します。
-
HTTP Listener
URI パラメーターにジョブ ID が含まれる HTTP DELETE 要求からデータを受け取ります。 -
Logger
Delete Job 操作からの HTTP 応答を表示します。 -
Delete Job
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
URI パラメーターで使用されたジョブ ID を受け取ります。
-
Salesforce API をコールして、ジョブを削除します。
-
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:salesforce="http://www.mulesoft.org/schema/mule/salesforce" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/salesforce http://www.mulesoft.org/schema/mule/salesforce/current/mule-salesforce.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" audienceUrl="${server.audienceUrl}" keyAlias="${server.certificateAlias}" />
</sdc:sdc-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}" username="${server.userName}" password="${server.password}" audienceUrl="${server.audienceUrl}" />
</sdc:sdc-config>
<flow name="DeleteJob" >
<http:listener doc:name="Delete /jobs/delete/{jobId}" config-ref="HTTP_Listener_config" path="/jobs/delete/{jobId}"/>
<sdc:delete-bulk-job doc:name="Delete Job" config-ref="Salesforce_CDP_OAuth_JWT_config" idUriParam="#[attributes.uriParams.jobId]"/>
<logger level="INFO" doc:name="Logger" />
</flow>
</mule>
この例の実行手順
-
プロジェクトを保存します。
-
ジョブを作成し、結果のジョブ ID をコピーします。
-
コピーしたジョブを使用して、ジョブを終了します ([Close Job - Bulk API]フローを参照)。
-
前の手順でコピーしたジョブ ID を使用して
DELETE を localhost:8081/jobs/delete/{JOB_ID} に送信し、フローをテストします。
インサイト - メタデータのリスト API
この Mule フローでは、すべての計算済みインサイトのディメンションと検索条件などのメタデータを取得する方法を示します。
この例では、次の操作を使用します。
-
HTTP Listener
HTTP GET 要求を受け取ります。 -
Insights - List Metadata
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
Salesforce CDP API をコールして、すべての計算済みインサイトのメタデータを返します。
-
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<mule xmlns:salesforce="http://www.mulesoft.org/schema/mule/salesforce" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/salesforce http://www.mulesoft.org/schema/mule/salesforce/current/mule-salesforce.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" audienceUrl="${server.audienceUrl}" keyAlias="${server.certificateAlias}" />
</sdc:sdc-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}" username="${server.userName}" password="${server.password}" audienceUrl="${server.audienceUrl}" />
</sdc:sdc-config>
<flow name="List_Calculated_Insights_Metadata" >
<http:listener doc:name="GET /insight/metadata" allowedMethods="GET" path="/insight/metadata" config-ref="HTTP_Listener_config"/>
<sdc:get-all-calculated-insight-metadata doc:name="Insights - List Metadata" config-ref="Salesforce_CDP_OAuth_JWT_config"/>
</flow>
</mule>
インサイト - メタデータの取得 API
この Mule フローでは、計算済みインサイトのディメンションと検索条件などのメタデータを取得する方法を示します。使用方法と詳細については、 『Salesforce CDP API 開発者ガイド』を参照してください。
この例では、次の操作を使用します。
-
HTTP Listener
必須 URI パラメーターとして計算済みインサイト名が含まれる HTTP GET 要求を受け取ります。 -
Insights - Get Metadata
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
計算済みインサイト名を受け取ります。
-
Salesforce CDP API をコールして、要求された計算済みインサイトのメタデータを返します。
-
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<mule xmlns:salesforce="http://www.mulesoft.org/schema/mule/salesforce" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/salesforce http://www.mulesoft.org/schema/mule/salesforce/current/mule-salesforce.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" audienceUrl="${server.audienceUrl}" keyAlias="${server.certificateAlias}" />
</sdc:sdc-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}" username="${server.userName}" password="${server.password}" audienceUrl="${server.audienceUrl}" />
</sdc:sdc-config>
<flow name="Get_Calculated_Insights_Metadata" >
<http:listener doc:name="GET /insight/metadata/{ci_name}" config-ref="HTTP_Listener_config" path="/insight/metadata/{ci_name}" allowedMethods="GET"/>
<sdc:get-calculated-insight-metadata doc:name="Insights - Get Metadata" config-ref="Salesforce_CDP_OAuth_JWT_config" ciNameUriParam="#[attributes.uriParams.ci_name]"/>
</flow>
</mule>
インサイト - インサイトの取得 API
この Mule フローでは、計算済みインサイトを照会する方法を示します。ユーザーはさまざまなディメンション、基準、検索条件を選択することによって、分析や絞り込みを行うことができます。使用方法と詳細については、 『Salesforce CDP API 開発者ガイド』を参照してください。
この例では、次の操作を使用します。
-
HTTP Listener
必須 URI パラメーターとしての計算済みインサイト名と省略可能なクエリパラメーターの組み合わせが含まれる HTTP GET 要求を受け取ります。 -
Insights - Get Insights
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
計算済みインサイト名と省略可能なその他の URI パラメーターを受け取ります。
-
Salesforce CDP API をコールして、クエリ条件に一致する要求された計算済みインサイトのレコードを返します。
-
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<mule xmlns:salesforce="http://www.mulesoft.org/schema/mule/salesforce" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/salesforce http://www.mulesoft.org/schema/mule/salesforce/current/mule-salesforce.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" audienceUrl="${server.audienceUrl}" keyAlias="${server.certificateAlias}" />
</sdc:sdc-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}" username="${server.userName}" password="${server.password}" audienceUrl="${server.audienceUrl}" />
</sdc:sdc-config>
<flow name="Get_Calculated_Insights" >
<http:listener doc:name="GET /insight/calculated-insights/{ci_name}" config-ref="HTTP_Listener_config" path="/insight/calculated-insights/{ci_name}" allowedMethods="GET"/>
<sdc:get-calculated-insight-with-filters-fields-and-limit doc:name="Insights - Get Insights" config-ref="Salesforce_CDP_OAuth_JWT_config" ciNameUriParam="#[attributes.uriParams.ci_name]" dimensionsQueryParam="#[attributes.queryParams.dimensions]" measuresQueryParam="#[attributes.queryParams.measures]" limitQueryParam="#[attributes.queryParams.limit]" offsetQueryParam="#[attributes.queryParams.offset]" filtersQueryParam="#[attributes.queryParams.filters]" orderbyQueryParam="#[attributes.queryParams.orderby]" timeGranularityQueryParam="#[attributes.queryParams.timeGranularity]"/>
</flow>
</mule>
プロファイル - メタデータのリスト API
この Mule フローでは、データモデルオブジェクトのリストとその項目およびカテゴリを取得する方法を示します。使用方法と詳細については、 『Salesforce CDP API 開発者ガイド』を参照してください。
この例では、次の操作を使用します。
-
HTTP Listener
HTTP GET 要求を受け取ります。 -
Profile - List Metadata
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
Salesforce CDP API をコールして、データモデルオブジェクトのリストとその項目およびカテゴリを返します。
-
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd">
<flow name="Data_Action_Webhook" doc:id="3072197f-ee1f-4ed5-99d2-a9fa62230dbf" >
<sdc:webhook-listener doc:name="Data Action Webhook" doc:id="fe3a924a-ba94-447d-9d3c-df079fc01de2" config-ref="Salesforce_CDP_Sdc_webhook_config" path="${webhook.path}" signingKey="${webhook.signingKey}" signingAlgorithm="HmacSHA256"/>
<logger level="INFO" doc:name="Log Payload" doc:id="716538d3-7d06-4e9c-a4f7-b0d350b4dafe" message="#[output application/json --- payload]"/>
<mule xmlns:salesforce="http://www.mulesoft.org/schema/mule/salesforce" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/salesforce http://www.mulesoft.org/schema/mule/salesforce/current/mule-salesforce.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" audienceUrl="${server.audienceUrl}" keyAlias="${server.certificateAlias}" />
</sdc:sdc-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}" username="${server.userName}" password="${server.password}" audienceUrl="${server.audienceUrl}" />
</sdc:sdc-config>
<flow name="List_Profile_Metadata" >
<http:listener doc:name="GET /profile/metadata" allowedMethods="GET" path="/profile/metadata" config-ref="HTTP_Listener_config"/>
<sdc:get-meta-by-category doc:name="Profile - List Metadata" config-ref="Salesforce_CDP_OAuth_JWT_config"/>
</flow>
</mule>
プロファイル - メタデータの取得 API
この Mule フローでは、すべてのデータモデルオブジェクトのメタデータを取得する方法を示します。使用方法と詳細については、 『Salesforce CDP API 開発者ガイド』を参照してください。
この例では、次の操作を使用します。
-
HTTP Listener
必須 URI パラメーターとしてデータモデル名が含まれる HTTP GET 要求を受け取ります。 -
Profile - Get Metadata
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
データモデル名を受け取ります。
-
Salesforce CDP API をコールして、要求されたデータモデルオブジェクトのメタデータを返します。
-
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<mule xmlns:salesforce="http://www.mulesoft.org/schema/mule/salesforce" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/salesforce http://www.mulesoft.org/schema/mule/salesforce/current/mule-salesforce.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" audienceUrl="${server.audienceUrl}" keyAlias="${server.certificateAlias}" />
</sdc:sdc-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}" username="${server.userName}" password="${server.password}" audienceUrl="${server.audienceUrl}" />
</sdc:sdc-config>
<flow name="Get_Profile_Metadata" >
<http:listener doc:name="GET /profile/metadata/{dataModelName}" allowedMethods="GET" path="/profile/metadata/{dataModelName}" config-ref="HTTP_Listener_config"/>
<sdc:get-meta doc:name="Profile - Get Metadata" config-ref="Salesforce_CDP_OAuth_JWT_config" dataModelNameUriParam="#[attributes.uriParams.dataModelName]"/>
</flow>
</mule>
プロファイル - レコードの検索 API
この Mule フローでは、検索条件に基づいてデータモデルオブジェクトレコードを取得する方法を示します。使用方法と詳細については、 『Salesforce CDP API 開発者ガイド』を参照してください。
この例では、次の操作を使用します。
-
HTTP Listener
必須 URI パラメーターとしてのデータモデル名、必須クエリパラメーターとしての項目、さらにその他のクエリパラメーターの組み合わせが含まれる HTTP GET 要求を受け取ります。 -
Profile - Search Records
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
データモデル名、項目、省略可能なクエリパラメーターを受け取ります。
-
Salesforce CDP API をコールして、検索条件に基づいてデータモデルオブジェクトレコードを返します。
-
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<mule xmlns:salesforce="http://www.mulesoft.org/schema/mule/salesforce" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/salesforce http://www.mulesoft.org/schema/mule/salesforce/current/mule-salesforce.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" audienceUrl="${server.audienceUrl}" keyAlias="${server.certificateAlias}" />
</sdc:sdc-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}" username="${server.userName}" password="${server.password}" audienceUrl="${server.audienceUrl}" />
</sdc:sdc-config>
<flow name="Search_Profile_Records" >
<http:listener doc:name="GET /profile/{dataModelName}" config-ref="HTTP_Listener_config" path="/profile/{dataModelName}"/>
<sdc:get-parent-with-filters doc:name="Profile - Search Records" config-ref="Salesforce_CDP_OAuth_JWT_config" dataModelNameUriParam="#[attributes.uriParams.dataModelName]" orderbyQueryParam="#[attributes.queryParams.orderby]" filtersQueryParam="#[attributes.queryParams.filters]" fieldsQueryParam="#[attributes.queryParams.fields]" limitQueryParam="#[attributes.queryParams.limit]" offsetQueryParam="#[attributes.queryParams.offset]"/>
</flow>
</mule>
プロファイル - ID によるレコードの検索 API
この Mule フローでは、検索インデックスと検索条件に基づいてデータモデルオブジェクトレコードを取得する方法を示します。使用方法と詳細については、 『Salesforce CDP API 開発者ガイド』を参照してください。
この例では、次の操作を使用します。
-
HTTP Listener
必須 URI パラメーターとしてのデータモデル名と ID、省略可能なクエリパラメーターの組み合わせが含まれる HTTP GET 要求を受け取ります。 -
Profile - Search Records By Id
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
データモデル名、ID、省略可能なクエリパラメーターを受け取ります。
-
Salesforce CDP API をコールして、検索インデックスと検索条件に基づいてデータモデルオブジェクトレコードを返します。
-
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<mule xmlns:salesforce="http://www.mulesoft.org/schema/mule/salesforce" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/salesforce http://www.mulesoft.org/schema/mule/salesforce/current/mule-salesforce.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" audienceUrl="${server.audienceUrl}" keyAlias="${server.certificateAlias}" />
</sdc:sdc-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}" username="${server.userName}" password="${server.password}" audienceUrl="${server.audienceUrl}" />
</sdc:sdc-config>
<flow name="Search_Profile_Records_By_Id" >
<http:listener doc:name="GET /profile/{dataModelName}/{Id}" config-ref="HTTP_Listener_config" path="/profile/{dataModelName}/{Id}"/>
<sdc:get-parent doc:name="Profile - Search Records By Id" config-ref="Salesforce_CDP_OAuth_JWT_config" dataModelNameUriParam="#[attributes.uriParams.dataModelName]" idUriParam="#[attributes.uriParams.Id]" searchKeyQueryParam="#[attributes.queryParams.searchKey]" fieldsQueryParam="#[attributes.queryParams.fields]" filtersQueryParam="#[attributes.queryParams.filters]" limitQueryParam="#[attributes.queryParams.limit]" orderbyQueryParam="#[attributes.queryParams.orderby]" offsetQueryParam="#[attributes.queryParams.offset]"/>
</flow>
</mule>
プロファイル - レコードと子レコードの検索 API
この Mule フローでは、インデックスと検索条件に基づいてデータモデルオブジェクトレコードと子データモデルオブジェクトレコードを取得する方法を示します。使用方法と詳細については、 『Salesforce CDP API 開発者ガイド』を参照してください。
この例では、次の操作を使用します。
-
HTTP Listener
必須 URI パラメーターとしてのデータモデル名、子データモデル名、ID と、省略可能なクエリパラメーターの組み合わせが含まれる HTTP GET 要求を受け取ります。 -
Profile - Search Records With Child Records
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
データモデル名、子データモデル名、ID と、省略可能なクエリパラメーターを受け取ります。
-
Salesforce CDP API をコールして、インデックスと検索条件に基づいてデータモデルオブジェクトレコードと子データモデルオブジェクトレコードを返します。
-
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<mule xmlns:salesforce="http://www.mulesoft.org/schema/mule/salesforce" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/salesforce http://www.mulesoft.org/schema/mule/salesforce/current/mule-salesforce.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" audienceUrl="${server.audienceUrl}" keyAlias="${server.certificateAlias}" />
</sdc:sdc-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}" username="${server.userName}" password="${server.password}" audienceUrl="${server.audienceUrl}" />
</sdc:sdc-config>
<flow name="Search_Profile_Records_With_Child_Records" >
<http:listener doc:name="Get /profile/{dataModelName}/{id}/{childDataModelName}" allowedMethods="GET" config-ref="HTTP_Listener_config" path="/profile/{dataModelName}/{id}/{childDataModelName}"/>
<sdc:get-parent-and-child doc:name="Profile - Search Records With Child Records" searchKeyQueryParam="#[attributes.queryParams.searchKey]" fieldsQueryParam="#[attributes.queryParams.fields]" limitQueryParam="#[attributes.queryParams.limit]" filtersQueryParam="#[attributes.queryParams.filters]" offsetQueryParam="#[attributes.queryParams.offset]" orderbyQueryParam="#[attributes.queryParams.orderby]" dataModelNameUriParam="#[attributes.uriParams.dataModelName]" idUriParam="#[attributes.uriParams.id]" childDataModelNameUriParam="#[attributes.uriParams.childDataModelName]" config-ref="Salesforce_CDP_OAuth_JWT_config"/>
</flow>
</mule>
プロファイル - レコードとインサイトの検索 API
この Mule フローでは、インデックスと検索条件に基づいてデータモデルオブジェクトレコードと計算済みビューを取得する方法を示します。使用方法と詳細については、 『Salesforce CDP API 開発者ガイド』を参照してください。
この例では、次の操作を使用します。
-
HTTP Listener
必須 URI パラメーターとしてのデータモデル名、ID、計算済みインサイト名と、省略可能なクエリパラメーターの組み合わせが含まれる HTTP GET 要求を受け取ります。 -
Profile - Search Records With Insight
-
JWT を選択したかユーザー名とパスワードを選択したかに基づいて認証します。
-
データモデル名、ID、計算済みインサイト名と、省略可能なクエリパラメーターを受け取ります。
-
Salesforce CDP API をコールして、インデックスと検索条件に基づいてデータモデルオブジェクトレコードと計算済みビューを返します。
-
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<mule xmlns:salesforce="http://www.mulesoft.org/schema/mule/salesforce" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/salesforce http://www.mulesoft.org/schema/mule/salesforce/current/mule-salesforce.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<sdc:sdc-config name="Salesforce_CDP_OAuth_JWT_config" doc:name="Salesforce CDP config" >
<sdc:oauth-jwt-connection consumerKey="${server.consumerKey}" keyStorePath="${server.keyStorePath}" storePassword="${server.keyStorePassword}" subject="${server.userName}" audienceUrl="${server.audienceUrl}" keyAlias="${server.certificateAlias}" />
</sdc:sdc-config>
<configuration-properties doc:name="Configuration properties" file="mule-app.properties" />
<sdc:sdc-config name="Salesforce_CDP_OAuth_UsernamePassword_config" doc:name="Salesforce CDP config" >
<sdc:oauth-user-pass-connection clientId="${server.consumerKey}" clientSecret="${server.consumerSecret}" username="${server.userName}" password="${server.password}" audienceUrl="${server.audienceUrl}" />
</sdc:sdc-config>
<flow name="Search_Profile_Records_With_Insight" >
<http:listener doc:name="GET /profile/{dataModelName}/{id}/calculated-insights/{ci_name}" allowedMethods="GET" config-ref="HTTP_Listener_config" path="/profile/{dataModelName}/{id}/calculated-insights/{ci_name}"/>
<sdc:get-computed-view-for-profile doc:name="Profile - Search Records With Insight" config-ref="Salesforce_CDP_OAuth_JWT_config" dataModelNameUriParam="#[attributes.uriParams.dataModelName]" idUriParam="#[attributes.uriParams.id]" ciNameUriParam="#[attributes.uriParams.ci_name]" searchKeyQueryParam="#[attributes.queryParams.searchKey]" dimensionsQueryParam="#[attributes.queryParams.dimensions]" measuresQueryParam="#[attributes.queryParams.measures]" limitQueryParam="#[attributes.queryParams.limit]" filtersQueryParam="#[attributes.queryParams.filters]" offsetQueryParam="#[attributes.queryParams.offset]" orderbyQueryParam="#[attributes.queryParams.orderby]" timeGranularityQueryParam="#[attributes.queryParams.timeGranularity]"/>
</flow>
</mule>
データアクション Web フック
この Mule フローでは、データアクションによってトリガーされたときにペイロードを記録する Web フックを作成する方法を示します。 Salesforce データアクションのドキュメントを参照してください。
この例では、次の操作を使用します。
-
データアクション Web フック
Salesforce CDP データアクションのターゲットとして Web フックを作成します。 -
Logger
データアクション Web フックに送信されたペイロードを表示します。
この例の XML
この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:sdc="http://www.mulesoft.org/schema/mule/sdc"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/sdc http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd">
<flow name="Data_Action_Webhook" doc:id="3072197f-ee1f-4ed5-99d2-a9fa62230dbf" >
<sdc:webhook-listener doc:name="Data Action Webhook" doc:id="fe3a924a-ba94-447d-9d3c-df079fc01de2" config-ref="Salesforce_CDP_Sdc_webhook_config" path="${webhook.path}" signingKey="${webhook.signingKey}" signingAlgorithm="HmacSHA256"/>
<logger level="INFO" doc:name="Log Payload" doc:id="716538d3-7d06-4e9c-a4f7-b0d350b4dafe" message="#[output application/json --- payload]"/>
</flow>
</mule>
この例の実行手順
-
ストリーミングインサイトを作成済みであることを確認します。
-
データアクションターゲットを作成済みであり、アクションターゲット種別が
Webhook であることを確認します。 -
データアクションターゲットを使用してストリーミング計算済みインサイトに対して条件を実行する データアクションを作成済みであることを確認します。
-
プロジェクトを保存します。
-
データアクションターゲットがアプリケーション URL を参照するようにします。アプリケーション URL は
https://{{app-name}}.{{region}}.cloudhub.io/webhook のようになります。 -
データアクションの条件をトリガーしてフローをテストし、記録されたペイロードを確認します。