使用Destination SDK配置基于文件的目标
概述 overview
本页介绍如何使用目标SDK🔗中的配置选项以及其他Destination SDK功能和API参考文档中的信息来配置基于文件的目标。 步骤按以下顺序排列。
先决条件 prerequisites
在继续执行以下步骤之前,请阅读Destination SDK快速入门页面,了解有关获取使用Destination SDKAPI所必需的Adobe I/O身份验证凭据和其他先决条件的信息。
在Destination SDK中使用配置选项设置目标的步骤 steps
步骤1:创建服务器和文件配置 create-server-file-configuration
首先使用/destinations-server
端点创建服务器和文件配置。
下面显示了Amazon S3目标的配置示例。 有关配置中使用的字段以及配置其他类型的基于文件的目标的更多详细信息,请参阅它们对应的服务器配置。
API格式
POST platform.adobe.io/data/core/activation/authoring/destination-servers
{
"name": "S3 destination",
"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": {
"quote": {
"templatingStrategy": "NONE",
"value": "\""
},
"quoteAll": {
"templatingStrategy": "NONE",
"value": "false"
},
"escape": {
"templatingStrategy": "NONE",
"value": "\\"
},
"escapeQuotes": {
"templatingStrategy": "NONE",
"value": "true"
},
"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]"
},
"charToEscapeQuoteEscaping": {
"templatingStrategy": "NONE",
"value": "\\"
},
"emptyValue": {
"templatingStrategy": "NONE",
"value": ""
}
}
}
}
步骤2:创建目标配置 create-destination-configuration
下面显示的是使用/destinations
API端点创建的目标配置示例。
要将步骤1中的服务器和文件配置连接到此目标配置,请在此处添加服务器和文件配置的instance ID
作为destinationServerId
。
API格式
POST platform.adobe.io/data/core/activation/authoring/destinations
{
"name": "Amazon S3 destination",
"description": "Amazon S3 destination is a fictional destination, used for this example.",
"status": "Test",
"customerAuthenticationConfigurations": [
{
"authType": "S3"
}
],
"customerEncryptionConfigurations": [],
"customerDataFields": [
{
"name": "bucketName",
"title": "Amazon S3 bucket name",
"description": "Enter the Amazon S3 Bucket name that will host the exported files.",
"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": "Amazon S3 path",
"description": "Enter Amazon S3 folder path",
"type": "string",
"isRequired": true,
"pattern": "^[0-9a-zA-Z\\/\\!\\-_\\.\\*\\''\\(\\)]*((\\%SEGMENT_(NAME|ID)\\%)?\\/?)+$",
"readOnly": false,
"hidden": false
},
{
"name": "compression",
"title": "Select compression type",
"description": "Select the file compression type used by the exported files.",
"type": "string",
"isRequired": true,
"readOnly": false,
"enum": [
"GZIP",
"NONE",
"bzip2",
"lz4",
"snappy",
"deflate"
]
},
{
"name": "fileType",
"title": "Select a file format",
"description": "Select the file format to be used by the exported files.",
"type": "string",
"isRequired": true,
"readOnly": false,
"hidden": false,
"enum": [
"csv",
"json",
"parquet"
],
"default": "csv"
}
],
"uiAttributes": {
"documentationLink": "https://www.adobe.com/go/destinations-YOURDESTINATION-en",
"category": "S3",
"connectionType": "S3",
"flowRunsSupported": true,
"monitoringSupported": true,
"frequency": "Batch"
},
"destinationDelivery": [
{
"deliveryMatchers": [
{
"type": "SOURCE",
"value": [
"batch"
]
}
],
"authenticationRule": "CUSTOMER_AUTHENTICATION",
"destinationServerId": "eec25bde-4f56-4c02-a830-9aa9ec73ee9d"
}
],
"schemaConfig": {
"profileRequired": true,
"segmentRequired": true,
"identityRequired": true
},
"batchConfig": {
"allowMandatoryFieldSelection": true,
"allowDedupeKeyFieldSelection": true,
"defaultExportMode": "DAILY_FULL_EXPORT",
"allowedExportMode": [
"DAILY_FULL_EXPORT",
"FIRST_FULL_THEN_INCREMENTAL"
],
"allowedScheduleFrequency": [
"DAILY",
"EVERY_3_HOURS",
"EVERY_6_HOURS",
"EVERY_8_HOURS",
"EVERY_12_HOURS",
"ONCE"
],
"defaultFrequency": "DAILY",
"defaultStartTime": "00:00",
"filenameConfig":{
"allowedFilenameAppendOptions":[
"SEGMENT_NAME",
"DESTINATION_INSTANCE_ID",
"DESTINATION_INSTANCE_NAME",
"ORGANIZATION_NAME",
"SANDBOX_NAME",
"DATETIME",
"CUSTOM_TEXT"
],
"defaultFilenameAppendOptions":[
"DATETIME"
],
"defaultFilename":"%DESTINATION%_%SEGMENT_ID%"
}
},
"backfillHistoricalProfileData": true
}
步骤3:创建受众元数据配置 create-audience-metadata-configuration
对于某些目标,Destination SDK需要您将受众元数据配置配置为以编程方式创建、更新或删除目标中的受众。 有关何时需要设置此配置以及如何设置的信息,请参阅受众元数据管理。
如果使用受众元数据配置,则必须将其连接到在步骤2中创建的目标配置。 将受众元数据配置的实例ID作为audienceTemplateId
添加到目标配置中。
{
"name": "Amazon S3 destination",
"description": "Amazon S3 destination is a fictional destination, used for this example.",
"status": "Test",
"customerAuthenticationConfigurations": [
{
"authType": "S3"
}
],
"customerEncryptionConfigurations": [],
"customerDataFields": [
{
"name": "bucketName",
"title": "Amazon S3 bucket name",
"description": "Enter the Amazon S3 Bucket name that will host the exported files.",
"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": "Amazon S3 path",
"description": "Enter Amazon S3 folder path",
"type": "string",
"isRequired": true,
"pattern": "^[0-9a-zA-Z\\/\\!\\-_\\.\\*\\''\\(\\)]*((\\%SEGMENT_(NAME|ID)\\%)?\\/?)+$",
"readOnly": false,
"hidden": false
},
{
"name": "compression",
"title": "Select compression type",
"description": "Select the file compression type used by the exported files.",
"type": "string",
"isRequired": true,
"readOnly": false,
"enum": [
"GZIP",
"NONE",
"bzip2",
"lz4",
"snappy",
"deflate"
]
},
{
"name": "fileType",
"title": "Select a file format",
"description": "Select the file format to be used by the exported files.",
"type": "string",
"isRequired": true,
"readOnly": false,
"hidden": false,
"enum": [
"csv",
"json",
"parquet"
],
"default": "csv"
}
],
"uiAttributes": {
"documentationLink": "http://www.adobe.com/go/destinations-YOURDESTINATION-en",
"category": "S3",
"connectionType": "S3",
"flowRunsSupported": true,
"monitoringSupported": true,
"frequency": "Batch"
},
"destinationDelivery": [
{
"deliveryMatchers": [
{
"type": "SOURCE",
"value": [
"batch"
]
}
],
"authenticationRule": "CUSTOMER_AUTHENTICATION",
"destinationServerId": "eec25bde-4f56-4c02-a830-9aa9ec73ee9d"
}
],
"audienceMetadataConfig":{
"mapExperiencePlatformSegmentName":false,
"mapExperiencePlatformSegmentId":false,
"mapUserInput":false,
"audienceTemplateId":"cbf90a70-96b4-437b-86be-522fbdaabe9c"
},
"schemaConfig": {
"profileRequired": true,
"segmentRequired": true,
"identityRequired": true
},
"batchConfig": {
"allowMandatoryFieldSelection": true,
"allowDedupeKeyFieldSelection": true,
"defaultExportMode": "DAILY_FULL_EXPORT",
"allowedExportMode": [
"DAILY_FULL_EXPORT",
"FIRST_FULL_THEN_INCREMENTAL"
],
"allowedScheduleFrequency": [
"DAILY",
"EVERY_3_HOURS",
"EVERY_6_HOURS",
"EVERY_8_HOURS",
"EVERY_12_HOURS",
"ONCE"
],
"defaultFrequency": "DAILY",
"defaultStartTime": "00:00",
"filenameConfig":{
"allowedFilenameAppendOptions":[
"SEGMENT_NAME",
"DESTINATION_INSTANCE_ID",
"DESTINATION_INSTANCE_NAME",
"ORGANIZATION_NAME",
"SANDBOX_NAME",
"DATETIME",
"CUSTOM_TEXT"
],
"defaultFilenameAppendOptions":[
"DATETIME"
],
"defaultFilename":"%DESTINATION%_%SEGMENT_ID%"
}
},
"backfillHistoricalProfileData": true
}
步骤4:设置身份验证 set-up-authentication
根据您在上面的目标配置中指定"authenticationRule": "CUSTOMER_AUTHENTICATION"
还是"authenticationRule": "PLATFORM_AUTHENTICATION"
,可以使用/destination
或/credentials
端点为目标设置身份验证。
CUSTOMER_AUTHENTICATION
是两个身份验证规则中比较常见的一个,如果您要求用户在设置连接和导出数据之前向您的目标提供某种形式的身份验证,则应该使用。-
如果您在目标配置中选择了
"authenticationRule": "CUSTOMER_AUTHENTICATION"
,请参阅以下部分,了解基于文件的目标的Destination SDK所支持的身份验证类型: -
如果您选择了
"authenticationRule": "PLATFORM_AUTHENTICATION"
,请参阅凭据配置API文档。
步骤5:测试您的目标 test-destination
使用前面步骤中的配置端点设置目标后,您可以使用目标测试工具来测试Adobe Experience Platform与您的目标之间的集成。
在测试目标的过程中,您必须使用Experience PlatformUI创建受众,并将受众激活到目标。 有关如何在Experience Platform中创建受众的说明,请参阅以下两个资源:
步骤6:Publish您的目标 publish-destination
配置和测试目标后,使用目标发布API将配置提交给Adobe进行审核。
步骤7:记录您的目标 document-destination
如果您是创建产品化集成的独立软件供应商(ISV)或系统集成商(SI),请使用自助文档流程在Experience Platform目标目录中为您的目标创建产品文档页面。
步骤8:提交目标以供Adobe审核 submit-for-review
最后,在Experience Platform目录中发布目标并对所有Experience Platform客户可见之前,您需要正式提交目标以供Adobe审查。 查找有关如何提交以供审阅在Destination SDK中创作的产品化目标的完整信息。