設定資料集匯出目的地

概觀 overview

此頁面說明如何使用Destination SDK來設定支援資料集匯出的目的地。 使用資料集匯出目的地,將原始資料集從Experience Platform匯出至外部儲存位置,以用於報告、資料科學工作流程和其他許多使用案例。

本指南一律以Amazon S3為例,但相同的設定原則適用於Destination SDK (Azure Blob Storage、SFTP、Azure Data Lake Storage Gen2、Google Cloud Storage和Data Landing Zone)支援的任何檔案型目的地型別。

如需本指南中所使用之所有引數的詳細說明,請參閱Destination SDK🔗中的組態選項。

先決條件 prerequisites

在前往下列步驟之前,請閱讀Destination SDK快速入門頁面,以取得使用Destination SDK API所需的必要Adobe I/O驗證認證和其他必要條件。

步驟1:建立伺服器和檔案組態 create-server-file-configuration

開始使用/destination-servers端點來建立伺服器和檔案組態

API格式

POST platform.adobe.io/data/core/activation/authoring/destination-servers

要求

下列要求會為Amazon S3目的地建立新的目的地伺服器組態。 fileTypecompression值已樣化,這表示它們將由客戶在目的地連線時間透過您在下一個步驟中定義的customerDataFields提供。

curl -X POST https://platform.adobe.io/data/core/activation/authoring/destination-servers \
 -H 'Authorization: Bearer {ACCESS_TOKEN}' \
 -H 'Content-Type: application/json' \
 -H 'x-gw-ims-org-id: {ORG_ID}' \
 -H 'x-api-key: {API_KEY}' \
 -H 'x-sandbox-name: {SANDBOX_NAME}' \
 -d '
{
   "name":"Amazon S3 dataset export destination server",
   "destinationServerType":"FILE_BASED_S3",
   "fileBasedS3Destination":{
      "bucket":{
         "templatingStrategy":"PEBBLE_V1",
         "value":"{{customerData.bucketName}}"
      },
      "path":{
         "templatingStrategy":"PEBBLE_V1",
         "value":"{{customerData.path}}"
      }
   },
   "fileConfigurations":{
      "compression":{
         "templatingStrategy":"PEBBLE_V1",
         "value":"{{customerData.compression}}"
      },
      "fileType":{
         "templatingStrategy":"PEBBLE_V1",
         "value":"{{customerData.fileType}}"
      },
      "csvOptions":{
         "quoteAll":{
            "templatingStrategy":"NONE",
            "value":"false"
         },
         "header":{
            "templatingStrategy":"NONE",
            "value":"true"
         },
         "ignoreLeadingWhiteSpace":{
            "templatingStrategy":"NONE",
            "value":"true"
         },
         "ignoreTrailingWhiteSpace":{
            "templatingStrategy":"NONE",
            "value":"true"
         },
         "nullValue":{
            "templatingStrategy":"NONE",
            "value":""
         },
         "dateFormat":{
            "templatingStrategy":"NONE",
            "value":"yyyy-MM-dd"
         },
         "timestampFormat":{
            "templatingStrategy":"NONE",
            "value":"yyyy-MM-dd'\''T'\'':mm:ss[.SSS][XXX]"
         }
      }
   }
}'

成功的回應會傳回新的目的地伺服器組態,包括組態的唯一識別碼(instanceId)。 將此值儲存為下一個步驟所需的值。

步驟2:建立目的地設定 create-destination-configuration

在上一步中建立目的地伺服器組態之後,請使用/destinations API端點來建立目的地組態。

若要將伺服器組態從步驟1連線至此目的地組態,請以在步驟1中建立您的目的地伺服器時取得的instanceId值,取代下列API要求中的destinationServerId值。

API格式

POST platform.adobe.io/data/core/activation/authoring/destinations

要求

curl -X POST https://platform.adobe.io/data/core/activation/authoring/destinations \
 -H 'Authorization: Bearer {ACCESS_TOKEN}' \
 -H 'Content-Type: application/json' \
 -H 'x-gw-ims-org-id: {ORG_ID}' \
 -H 'x-api-key: {API_KEY}' \
 -H 'x-sandbox-name: {SANDBOX_NAME}' \
 -d '
{
   "name":"Amazon S3 dataset export destination",
   "description":"Amazon S3 destination for exporting Experience Platform datasets.",
   "status":"TEST",
   "sources":[
      "DATASETS"
   ],
   "customerAuthenticationConfigurations":[
      {
         "authType":"S3"
      }
   ],
   "customerDataFields":[
      {
         "name":"bucketName",
         "title":"Enter the name of your Amazon S3 bucket",
         "description":"Amazon S3 bucket name",
         "type":"string",
         "isRequired":true,
         "pattern":"(?=^.{3,63}$)(?!^(\\d+\\.)+\\d+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])$)",
         "readOnly":false,
         "hidden":false
      },
      {
         "name":"path",
         "title":"Enter the path to your S3 bucket folder",
         "description":"Enter the path to your S3 bucket folder",
         "type":"string",
         "isRequired":true,
         "pattern":"^[0-9a-zA-Z\\/\\!\\-_\\.\\*\\''\\(\\)]*((\\%SEGMENT_(NAME|ID)\\%)?\\/?)+$",
         "readOnly":false,
         "hidden":false
      },
      {
         "name":"compression",
         "title":"Compression format",
         "description":"Select the desired file compression format.",
         "type":"string",
         "isRequired":true,
         "readOnly":false,
         "enum":[
            "GZIP",
            "NONE"
         ]
      },
      {
         "name":"fileType",
         "title":"File type",
         "description":"Select the exported file type.",
         "type":"string",
         "isRequired":true,
         "readOnly":false,
         "hidden":false,
         "enum":[
            "json",
            "parquet"
         ],
         "default":"parquet"
      }
   ],
   "uiAttributes":{
      "documentationLink":"https://www.adobe.com/go/destinations-amazon-s3-en",
      "category":"cloudStorage",
      "connectionType":"S3",
      "flowRunsSupported":true,
      "monitoringSupported":true,
      "frequency":"Batch"
   },
   "destinationDelivery":[
      {
         "deliveryMatchers":[
            {
               "type":"SOURCE",
               "value":[
                  "batch"
               ]
            }
         ],
         "authenticationRule":"CUSTOMER_AUTHENTICATION",
         "destinationServerId":"{{destinationServerId}}"
      }
   ],
   "schemaConfig":{
      "profileRequired":false,
      "segmentRequired":false,
      "identityRequired":false
   },
   "aggregation":{
      "aggregationType":"BEST_EFFORT"
   },
   "batchConfig":{
      "allowMandatoryFieldSelection":false,
      "allowDedupKeyFieldSelection":false,
      "defaultExportMode":"FIRST_FULL_THEN_INCREMENTAL",
      "allowedExportModes":[
         "DAILY_FULL_EXPORT",
         "FIRST_FULL_THEN_INCREMENTAL"
      ],
      "allowedScheduleFrequency":[],
      "defaultFrequency":"EVERY_6_HOURS",
      "defaultStartTime":"00:00",
      "filenameConfig":{
         "allowedFilenameAppendOptions":[],
         "defaultFilenameAppendOptions":[],
         "defaultFilename":""
      },
      "datasetBatchConfig":{
         "allowedFoldernameAppendOptions":[
            "DESTINATION",
            "DATASET_ID",
            "DATASET_NAME",
            "DESTINATION_INSTANCE_ID",
            "DESTINATION_INSTANCE_NAME",
            "ORGANIZATION_NAME",
            "SANDBOX_NAME",
            "DATETIME",
            "EXPORT_TIME",
            "CUSTOM_TEXT"
         ],
         "defaultFoldernameAppendOptions":[
            "DATASET_ID",
            "EXPORT_TIME"
         ],
         "allowedExportModes":[
            "DAILY_FULL_EXPORT",
            "FIRST_FULL_THEN_INCREMENTAL"
         ],
         "allowedScheduleFrequency":[
            "DAILY",
            "EVERY_3_HOURS",
            "EVERY_6_HOURS",
            "EVERY_8_HOURS",
            "EVERY_12_HOURS",
            "ONCE"
         ]
      }
   },
   "maxProfileAttributes":9000,
   "maxIdentityAttributes":1000,
   "backfillHistoricalProfileData":true
}'

與受眾匯出目的地設定之間的主要差異會在上方醒目提示:

參數
資料集匯出的值
說明
sources
["DATASETS"]
將此目的地標示為資料集匯出目的地。 請參閱設定對象資料型別以取得詳細資料。
schemaConfig.profileRequired
false
資料集不需要設定檔對應。
schemaConfig.segmentRequired
false
資料集不需要對象選取。
schemaConfig.identityRequired
false
資料集不需要身分對應。
aggregation.aggregationType
BEST_EFFORT
資料集匯出使用盡最大努力彙總。
batchConfig.datasetBatchConfig
請參閱上文
控制資料集匯出專用的資料夾命名和排程選項。 如需完整的引數詳細資訊,請參閱資料集匯出組態

成功的回應會傳回新的目的地組態,包括組態的唯一識別碼(instanceId)。

步驟3:設定驗證 set-up-authentication

根據您在上面的目的地組態中指定"authenticationRule": "CUSTOMER_AUTHENTICATION""authenticationRule": "PLATFORM_AUTHENTICATION",您可以使用/destination/credentials端點來設定驗證。

NOTE
CUSTOMER_AUTHENTICATION是兩個驗證規則中較常見的一個,如果您希望使用者在連線到您的目的地時提供自己的儲存認證,則需使用這個驗證規則。

步驟4:驗證Experience Platform UI verify-ui

根據上述設定,Experience Platform目錄現在會顯示新的私人目的地卡供您使用。

當使用者連線到目的地並選取要匯出的資料集時,他們會看到您在datasetBatchConfig中定義的排程和資料夾命名選項。

步驟5: (選用)發佈您的目的地 publish-destination

NOTE
如果您要建立供自己使用的私人目的地,且不想將其發佈到目的地目錄以供其他客戶使用,則不需要執行此步驟。

設定目的地後,請使用目的地發佈API將您的設定提交至Adobe以供檢閱。

步驟6: (選用)記錄您的目的地 document-destination

NOTE
如果您要建立供自己使用的私人目的地,且不想將其發佈到目的地目錄以供其他客戶使用,則不需要執行此步驟。

如果您是建立產品化整合的獨立軟體廠商(ISV)或系統整合商(SI),請使用自助服務檔案程式,為您在Experience Platform目的地目錄中的目的地建立產品檔案頁面。

後續步驟 next-steps

閱讀本文章,您現在瞭解如何使用Destination SDK製作資料集匯出目標。 接下來,您的團隊可以使用資料集匯出工作流程,將資料集匯出至您的目的地。

若要進一步瞭解您可以使用Destination SDK做什麼,請閱讀下列文章:

recommendation-more-help
experience-platform-help-destinations