使用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快速入门指南。
将MySQL连接到Azure上的Experience Platform
有关如何将您的MySQL帐户连接到Azure上的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
有关如何将您的MySQL帐户连接到AWS上的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。