為建立資料流 OneTrust Integration 來源使用 Flow Service API
下列教學課程將逐步引導您完成建立來源連線和資料流的步驟,以便從取得歷史同意資料和排程同意資料 OneTrust Integration 至Adobe Experience Platform,使用 Flow Service API.
先決條件
連線之前 OneTrust Integration 對於Platform,您必須先擷取存取權杖。 如需尋找存取權杖的詳細說明,請參閱 OneTrust Integration OAuth 2指南.
存取權杖過期後不會自動重新整理,因為系統間重新整理權杖不受支援 OneTrust. 因此,您必須確定您的存取權杖在過期之前已在連線中更新。 存取Token的最大可設定存留期為一年。 若要進一步瞭解如何更新存取權杖,請參閱 OneTrust 有關管理您的OAuth 2.0使用者端憑證的檔案.
Connect OneTrust Integration 至平台,使用 Flow Service API
下列教學課程將逐步引導您完成建立 OneTrust Integration 來源連線並建立資料流以帶來 OneTrust Integration 使用將資料傳送至Platform Flow Service API.
建立基礎連線 base-connection
基礎連線會保留您的來源和平台之間的資訊,包括來源的驗證認證、連線的目前狀態,以及您唯一的基本連線ID。 基本連線ID可讓您瀏覽和瀏覽來源內的檔案,並識別您要擷取的特定專案,包括其資料型別和格式的資訊。
POST若要建立基本連線ID,請向 /connections
端點,同時提供 OneTrust Integration 要求內文中的驗證認證。
API格式
POST /connections
要求
下列要求會建立 OneTrust Integration :
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": "ONETRUST base connection",
"description": "ONETRUST base connection to authenticate to Platform",
"connectionSpec": {
"id": "cf16d886-c627-4872-9936-fb08d6cba8cc",
"version": "1.0"
},
"auth": {
"specName": "OAuth2 Refresh Code",
"params": {
"accessToken": "{ACCESS_TOKEN}"
}
}
}'
name
description
connectionSpec.id
auth.specName
auth.params.
auth.params.accessToken
回應
成功回應會傳回新建立的基本連線,包括其唯一連線識別碼(id
)。 在下一個步驟中探索來源的檔案結構和內容時,需要此ID。
{
"id": "622124ca-6d18-47f7-999c-66f599955309",
"etag": "\"2e026443-0000-0200-0000-621f1af80000\""
}
探索您的來源 explore
使用您在上一步中產生的基本連線ID,您可以透過執行GET請求來探索檔案和目錄。
使用以下呼叫來尋找您要帶入的檔案路徑 Platform:
API格式
GET /connections/{BASE_CONNECTION_ID}/explore?objectType=rest&object={OBJECT}&fileType={FILE_TYPE}&preview={PREVIEW}
執行GET請求以探索來源的檔案結構和內容時,您必須包括下表列出的查詢引數:
{BASE_CONNECTION_ID}
objectType=rest
rest
.{OBJECT}
fileType=json
json
是唯一支援的檔案型別。{PREVIEW}
要求
curl -X GET \
'https://platform.adobe.io/data/foundation/flowservice/connections/622124ca-6d18-47f7-999c-66f599955309/explore?objectType=rest&object=json&fileType=json&preview=true' \
-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}'
回應
成功的回應會傳回查詢檔案的結構。
code language-json |
---|
|
建立來源連線 source-connection
您可以向以下發出POST要求來建立來源連線: Flow Service API。 來源連線由連線ID、來源資料檔案的路徑和連線規格ID組成。
API格式
POST /sourceConnections
要求
以下請求會為建立來源連線 OneTrust Integration :
curl -X POST \
'https://platform.adobe.io/data/foundation/flowservice/sourceConnections' \
-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": "ONETRUST Source Connection",
"description": "ONETRUST Source Connection",
"baseConnectionId": "622124ca-6d18-47f7-999c-66f599955309",
"connectionSpec": {
"id": "cf16d886-c627-4872-9936-fb08d6cba8cc",
"version": "1.0"
},
"data": {
"format": "json"
},
"params": {}
}'
name
description
baseConnectionId
connectionSpec.id
data.format
json
.回應
成功的回應會傳回唯一識別碼(id
)。 此ID在後續步驟中是建立資料流的必要專案。
{
"id": "eb5833d3-230d-4700-80cc-bda396e7af8a",
"etag": "\"da04c07f-0000-0200-0000-621f1afc0000\""
}
建立目標XDM結構描述 target-schema
為了在Platform中使用來源資料,必須建立目標結構描述,以根據您的需求來建構來源資料。 然後,目標結構描述會用於建立包含來源資料的Platform資料集。
可透過對以下專案執行POST請求來建立目標XDM結構描述: 結構描述登入API.
如需建立目標XDM結構的詳細步驟,請參閱以下教學課程: 使用API建立結構描述.
建立目標資料集 target-dataset
您可以透過對「 」執行POST請求來建立目標資料集 目錄服務API,在裝載中提供目標結構描述的ID。
如需建立目標資料集的詳細步驟,請參閱以下教學課程: 使用API建立資料集.
建立目標連線 target-connection
目標連線代表與要儲存所擷取資料的目的地之間的連線。 若要建立目標連線,您必須提供對應至 Data Lake. 此ID為: c604ff05-7f1a-43c0-8e18-33bf874cb11c
.
您現在將目標結構描述、目標資料集和連線規格ID視為唯一識別碼。 Data Lake. 使用這些識別碼,您可以使用 Flow Service 指定將包含傳入來源資料之資料集的API。
API格式
POST /targetConnections
要求
以下請求會建立目標連線 OneTrust Integration :
curl -X POST \
'https://platform.adobe.io/data/foundation/flowservice/targetConnections' \
-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": "ONETRUST Target Connection",
"description": "ONETRUST Target Connection",
"connectionSpec": {
"id": "c604ff05-7f1a-43c0-8e18-33bf874cb11c",
"version": "1.0"
},
"data": {
"format": "json"
},
"params": {
"dataSetId": "61f6ca3f33978c19486bb463"
}
}'
name
description
connectionSpec.id
c604ff05-7f1a-43c0-8e18-33bf874cb11c
.data.format
params.dataSetId
回應
成功回應會傳回新目標連線的唯一識別碼(id
)。 此ID在後續步驟中是必要的。
{
"id": "495f761f-310a-4a7b-ae78-5b1152d74b38",
"etag": "\"410a7b0c-0000-0200-0000-621f1afd0000\""
}
建立對應 mapping
為了將來源資料內嵌到目標資料集中,必須先將其對應到目標資料集所遵守的目標結構描述。 這是透過向執行POST請求來達成 Data Prep API 要求裝載中定義資料對應。
API格式
POST /conversion/mappingSets
要求
curl -X POST \
'https://platform.adobe.io/data/foundation/conversion/mappingSets' \
-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 '{
"version": 0,
"xdmSchema": "https://ns.adobe.com/{TENANT_ID}/schemas/cfc8cee182e546c1fb35071185524b465e06bf1acb74f30d",
"xdmVersion": "1.0",
"id": null,
"mappings": [{
"sourceType": "ATTRIBUTE",
"source": "content.Identifier",
"destination": "_id",
"name": "id",
"description": "Identifier field"
},
{
"sourceType": "ATTRIBUTE",
"source": "content.Identifier",
"destination": "_exchangesandboxbravo.Identifier"
},
{
"sourceType": "ATTRIBUTE",
"source": "content.Language",
"destination": "_exchangesandboxbravo.Language",
"description": "Language field"
},
{
"sourceType": "ATTRIBUTE",
"source": "content.CreatedDate",
"destination": "_exchangesandboxbravo.CreatedDate",
"description": "Created Date field"
},
{
"sourceType": "ATTRIBUTE",
"source": "content.LastUpdatedDate",
"destination": "_exchangesandboxbravo.LastUpdatedDate",
"description": "Created Date field"
},
{
"sourceType": "ATTRIBUTE",
"source": "content.DataElements",
"destination": "_exchangesandboxbravo.DataElements"
},
{
"sourceType": "ATTRIBUTE",
"source": "content.Purposes",
"destination": "_exchangesandboxbravo.Purposes"
}
]
}'
xdmSchema
mappings.destinationXdmPath
mappings.sourceAttribute
回應
成功回應會傳回新建立對應的詳細資料,包括其唯一識別碼(id
)。 在後續步驟中需要此值,才能建立資料流。
{
"id": "a87f130e82f04d5188da01f087805c4b",
"version": 0,
"createdDate": 1646205694395,
"modifiedDate": 1646205694395,
"createdBy": "{CREATED_BY}",
"modifiedBy": "{MODIFIED_BY}"
}
建立流程 flow
從以下來源取得資料的最後一步 OneTrust Integration 對Platform而言,就是建立資料流。 到現在為止,您已準備下列必要值:
資料流負責從來源排程及收集資料。 您可以執行POST要求,同時在裝載中提供先前提及的值,藉此建立資料流。
若要排程內嵌,您必須先將開始時間值設為以秒為單位的epoch時間。 然後,您必須將頻率值設定為下列五個選項之一: once
, minute
, hour
, day
,或 week
. 間隔值會指定兩個連續內嵌之間的期間,但是建立一次性內嵌不需要設定間隔。 對於所有其他頻率,間隔值必須設定為等於或大於 15
.
API格式
POST /flows
要求
curl -X POST \
'https://platform.adobe.io/data/foundation/flowservice/flows' \
-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": "ONETRUST dataflow",
"description": "ONETRUST dataflow",
"flowSpec": {
"id": "6499120c-0b15-42dc-936e-847ea3c24d72",
"version": "1.0"
},
"sourceConnectionIds": [
"eb5833d3-230d-4700-80cc-bda396e7af8a"
],
"targetConnectionIds": [
"495f761f-310a-4a7b-ae78-5b1152d74b38"
],
"transformations": [
{
"name": "Mapping",
"params": {
"mappingId": "a87f130e82f04d5188da01f087805c4b",
"mappingVersion": 0
}
}
],
"scheduleParams": {
"startTime": "1625040887",
"frequency": "minute",
"interval": 15
}
}'
name
description
flowSpec.id
6499120c-0b15-42dc-936e-847ea3c24d72
.flowSpec.version
1.0
.sourceConnectionIds
targetConnectionIds
transformations
transformations.name
transformations.params.mappingId
transformations.params.mappingVersion
0
.scheduleParams.startTime
scheduleParams.frequency
once
, minute
, hour
, day
,或 week
.scheduleParams.interval
once
和應大於或等於 15
(其他頻率值)。回應
成功的回應會傳回ID (id
)。 您可以使用此ID來監視、更新或刪除資料流。
{
"id": "70045189-42f0-493d-9b9e-be1045a9f4fa",
"etag": "\"1601e900-0000-0200-0000-621f1b080000\""
}
附錄
下節提供您可以監視、更新和刪除資料流的步驟相關資訊。
監視資料流
建立資料流後,您可以監視透過它擷取的資料,以檢視有關資料流執行、完成狀態和錯誤的資訊。 如需完整的API範例,請閱讀以下指南: 使用API監控您的來源資料流.
更新您的資料流
透過向以下專案發出PATCH請求,更新資料流的詳細資訊,例如其名稱和說明,及其執行排程和相關聯的對應集 /flows
端點 Flow Service API,同時提供資料流的ID。 提出PATCH請求時,您必須提供資料流的 etag
在 If-Match
標頭。 如需完整的API範例,請閱讀以下指南: 使用API更新來源資料流.
更新您的帳戶
透過對執行PATCH請求,更新來源帳戶的名稱、說明和認證 Flow Service API時,提供您的基本連線ID作為查詢引數。 提出PATCH請求時,您必須提供來源帳戶的唯一值 etag
在 If-Match
標頭。 如需完整的API範例,請閱讀以下指南: 使用API更新您的來源帳戶.
刪除您的資料流
透過對執行DELETE請求來刪除您的資料流 Flow Service API,同時提供您要作為查詢引數的一部分刪除的資料流的ID。 如需完整的API範例,請閱讀以下指南: 使用API刪除您的資料流.
刪除您的帳戶
透過對執行DELETE請求來刪除您的帳戶 Flow Service API,同時提供您要刪除之帳戶的基本連線ID。 如需完整的API範例,請閱讀以下指南: 使用API刪除您的來源帳戶.