文件Experience Platform來源連接器指南

使用Flow Service API連線MySQL至Experience Platform

最後更新: 2025年5月21日
  • 主題:

建立對象:

  • 開發人員

閱讀本指南,瞭解如何使用Flow Service API將您的MySQL帳戶連結至Adobe Experience Platform。

快速入門

本指南需要您深入了解下列 Adobe Experience Platform 元件:

  • 來源: Experience Platform允許從各種來源擷取資料,同時讓您能夠使用Experience Platform服務來建構、加標籤以及增強傳入的資料。
  • 沙箱: Experience Platform提供的虛擬沙箱可將單一Experience Platform執行個體分割成個別的虛擬環境,以利開發及改進數位體驗應用程式。

下列章節提供您需瞭解的其他資訊,才能使用Flow Service API成功連線到MySQL。

收集必要的認證

閱讀MySQL 總覽以取得驗證的相關資訊。

使用Experience Platform API

閱讀Experience Platform API快速入門的指南,瞭解如何成功呼叫Experience Platform API。

在Azure上連線MySQL至Experience Platform

請閱讀下列步驟,以瞭解如何在Azure上將您的MySQL帳戶連線至Experience Platform。

在Azure上的Experience Platform上為MySQL建立基礎連線

基礎連線會將您的來源連結至Experience Platform,以儲存驗證詳細資料、連線狀態和唯一ID。 使用此ID來瀏覽來源檔案並識別要擷取的特定專案,包括其資料型別和格式。

API格式

POST /connections

若要建立基底連線ID,請對/connections端點提出POST要求,並提供您的MySQL驗證認證作為要求引數的一部分。

要求

下列要求會使用以連線字串為基礎的驗證,為MySQL建立基礎連線。

檢視請求範例
curl -X POST \
  'https://platform.adobe.io/data/foundation/flowservice/connections' \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'x-sandbox-name: {SANDBOX_NAME}' \
  -H 'Content-Type: application/json' \
  -d '{
      "name": "MySQL Base Connection to Experience Platform",
      "description": "Via Connection String,
      "auth": {
          "specName": "Connection String Based Authentication",
          "params": {
              "connectionString": "Server={SERVER};Port={PORT};Database={DATABASE};UID={USERNAME};PWD={PASSWORD}"
          }
      },
      "connectionSpec": {
          "id": "26d738e0-8963-47ea-aadf-c60de735468a",
          "version": "1.0"
      }
  }'
屬性
說明
auth.params.connectionString
與您的帳戶相關聯的MySQL連線字串。 MySQL連線字串模式為: Server={SERVER};Port={PORT};Database={DATABASE};UID={USERNAME};PWD={PASSWORD}。
connectionSpec.id
MySQL連線規格識別碼: 26d738e0-8963-47ea-aadf-c60de735468a。

回應

成功的回應會傳回新建立的基礎連線的詳細資料,包括其唯一識別碼(id)。

檢視回應範例
{
    "id": "1a444165-3439-4c16-8441-653439dc166a",
    "etag": "\"5b04c219-0000-0200-0000-5e179c8f0000\""
}

要求

下列要求使用基本驗證建立MySQL來源的基本連線。

檢視請求範例
curl -X POST \
  'https://platform.adobe.io/data/foundation/flowservice/connections' \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'x-sandbox-name: {SANDBOX_NAME}' \
  -H 'Content-Type: application/json' \
  -d '{
      "name": "MySQL Base Connection to Experience Platform",
      "description": "Via Basic Authentication",
      "auth": {
          "specName": "Basic Authentication",
          "params": {
              "server": "localhost",
              "port": "443",
              "database": "mysql-acme",
              "username": "acme",
              "password": "xxxx",
              "sslMode": "DISABLED"
          }
      },
      "connectionSpec": {
          "id": "26d738e0-8963-47ea-aadf-c60de735468a",
          "version": "1.0"
      }
  }'
屬性
說明
auth.params.server
MySQL資料庫的名稱或IP。
auth.params.database
資料庫的名稱。
auth.params.username
與您的資料庫對應的使用者名稱。
auth.params.password
與資料庫對應的密碼。
auth.params.sslMode
資料傳輸期間加密資料的方法。
connectionSpec.id
MySQL連線規格識別碼為: 26d738e0-8963-47ea-aadf-c60de735468a。

回應

成功的回應會傳回新建立的基礎連線的詳細資料,包括其唯一識別碼(id)。

檢視回應範例
{
    "id": "025d4158-4113-403b-b551-e81724d3880c",
    "etag": "\"ae004437-0000-0200-0000-67ee107e0000\""
}

將MySQL連線至Amazon Web Services上的Experience Platform

AVAILABILITY
本節適用於在Amazon Web Services (AWS)上執行的Experience Platform實作。 目前有限數量的客戶可使用在AWS上執行的Experience Platform 。 若要進一步瞭解支援的Experience Platform基礎結構,請參閱Experience Platform多雲端總覽。

請閱讀下列步驟,以瞭解如何在AWS上將您的MySQL帳戶連結至Experience Platform。

在AWS上的Experience Platform上為MySQL建立基礎連線

API格式

POST /connections

要求

下列要求會建立MySQL的基礎連線,以連線至AWS上的Experience Platform。

檢視請求範例
curl -X POST \
  'https://platform.adobe.io/data/foundation/flowservice/connections' \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'x-sandbox-name: {SANDBOX_NAME}' \
  -H 'Content-Type: application/json' \
  -d '{
      "name": "MySQL on Experience Platform AWS",
      "description": "MySQL on Experience Platform AWS",
      "auth": {
          "specName": "Basic Authentication",
          "params": {
              "server": "localhost",
              "port": "443",
              "database": "mysql-acme",
              "username": "acme",
              "password": "xxxx",
              "sslMode": "false"
          }
      },
      "connectionSpec": {
          "id": "26d738e0-8963-47ea-aadf-c60de735468a",
          "version": "1.0"
      }
  }'
屬性
說明
auth.params.server
MySQL資料庫的名稱或IP。
auth.params.database
資料庫的名稱。
auth.params.username
與您的資料庫對應的使用者名稱。
auth.params.password
與資料庫對應的密碼。
auth.params.sslMode
根據您的伺服器支援,控制SSL是否強制執行的布林值。 此設定預設為false。
connectionSpec.id
MySQL連線規格識別碼為: 26d738e0-8963-47ea-aadf-c60de735468a。

回應

成功的回應會傳回新建立的基礎連線的詳細資料,包括其唯一識別碼(id)。

檢視回應範例
{
    "id": "f847950c-1c12-4568-a550-d5312b16fdb8",
    "etag": "\"0c0099f4-0000-0200-0000-67da91710000\""
}

建立MySQL資料的資料流

現在您已經成功連線MySQL資料庫,您現在可以建立資料流,並將資料庫中的資料擷取到Experience Platform。

recommendation-more-help
337b99bb-92fb-42ae-b6b7-c7042161d089