使用Flow Service API連線MySQL至Experience Platform
建立對象:
- 開發人員
閱讀本指南,瞭解如何使用Flow Service API將您的MySQL帳戶連結至Adobe Experience Platform。
快速入門
本指南需要您深入了解下列 Adobe 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
Server={SERVER};Port={PORT};Database={DATABASE};UID={USERNAME};PWD={PASSWORD}
。connectionSpec.id
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
auth.params.database
auth.params.username
auth.params.password
auth.params.sslMode
connectionSpec.id
26d738e0-8963-47ea-aadf-c60de735468a
。回應
成功的回應會傳回新建立的基礎連線的詳細資料,包括其唯一識別碼(id
)。
{
"id": "025d4158-4113-403b-b551-e81724d3880c",
"etag": "\"ae004437-0000-0200-0000-67ee107e0000\""
}
將MySQL連線至Amazon Web Services上的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
auth.params.database
auth.params.username
auth.params.password
auth.params.sslMode
false
。connectionSpec.id
26d738e0-8963-47ea-aadf-c60de735468a
。回應
成功的回應會傳回新建立的基礎連線的詳細資料,包括其唯一識別碼(id
)。
{
"id": "f847950c-1c12-4568-a550-d5312b16fdb8",
"etag": "\"0c0099f4-0000-0200-0000-67da91710000\""
}
建立MySQL資料的資料流
現在您已經成功連線MySQL資料庫,您現在可以建立資料流,並將資料庫中的資料擷取到Experience Platform。