이 튜토리얼에서는 프로토콜 소스에서 데이터를 검색하고 다음을 사용하여 플랫폼에 가져오는 단계를 다룹니다. Flow Service API.
데이터 흐름을 만들려면 프로토콜 원본이 있는 올바른 기본 연결 ID가 이미 있어야 합니다. 이 ID가 없는 경우 소스 개요 기본 연결을 만들 수 있는 프로토콜 원본 목록에 대해 설명합니다.
또한 이 자습서에서는 Adobe Experience Platform의 다음 구성 요소를 이해하고 있어야 합니다.
{TENANT_ID}
, "컨테이너"의 개념 및 요청을 하는 데 필요한 헤더(Accept 헤더 및 가능한 값에 특별한 주의 필요).Platform API를 성공적으로 호출하는 방법에 대한 자세한 내용은 의 안내서를 참조하십시오. platform API 시작하기.
에 POST 요청을 하여 소스 연결을 만들 수 있습니다. Flow Service API. 소스 연결은 연결 ID, 소스 데이터 파일에 대한 경로 및 연결 사양 ID로 구성됩니다.
소스 연결을 만들려면 데이터 형식 특성에 대한 열거형 값도 정의해야 합니다.
파일 기반 커넥터의 열거형 값은 다음과 같습니다.
데이터 형식 | 열거형 값 |
---|---|
구분됨 | delimited |
JSON | json |
쪽모이 세공 | parquet |
모든 테이블 기반 커넥터의 경우 값을 로 설정합니다. tabular
.
API 형식
POST /sourceConnections
요청
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": "Generic OData source connection",
"baseConnectionId": "a5c6b647-e784-4b58-86b6-47e784ab580b",
"description": "Generic OData source connection",
"data": {
"format": "tabular",
},
"params": {
"tableName": "Orders",
"columns": [
{
"name": "OrderID",
"type": "integer",
"xdm": {
"type": "integer",
"minimum": -2147483648,
"maximum": 2147483647
}
},
{
"name": "CustomerID",
"type": "string",
"xdm": {
"type": "string"
}
},
{
"name": "OrderDate",
"type": "string",
"meta:xdmType": "date-time",
"xdm": {
"type": "string",
"format": "date-time"
}
},
{
"name": "ShippedDate",
"type": "string",
"meta:xdmType": "date-time",
"xdm": {
"type": "string",
"format": "date-time"
}
}
]
},
"connectionSpec": {
"id": "8e6b41a8-d998-4545-ad7d-c6a9fff406c3",
"version": "1.0"
}
}'
속성 | 설명 |
---|---|
baseConnectionId |
프로토콜 응용 프로그램의 연결 ID |
params.path |
소스 파일의 경로입니다. |
connectionSpec.id |
프로토콜 응용 프로그램의 연결 사양 ID입니다. |
응답
성공적인 응답은 고유 식별자()를 반환합니다.id
)을 참조하십시오. 이 ID는 대상 연결을 만드는 이후 단계에서 필요합니다.
{
"id": "0a768941-ddfb-499d-b689-41ddfbf99db0",
"etag": "\"8f00753e-0000-0200-0000-5e8a547d0000\""
}
소스 데이터를 플랫폼에서 사용하려면 타겟 스키마를 만들어 필요에 따라 소스 데이터를 구조화해야 합니다. 그런 다음 대상 스키마를 사용하여 소스 데이터가 포함된 Platform 데이터 세트를 만듭니다.
에 대한 POST 요청을 수행하여 대상 XDM 스키마를 생성할 수 있습니다. 스키마 레지스트리 API.
대상 XDM 스키마를 만드는 방법에 대한 자세한 단계는 다음 자습서를 참조하십시오. api를 사용하여 스키마 만들기.
에 대한 POST 요청을 수행하여 타겟 데이터 세트를 생성할 수 있습니다. 카탈로그 서비스 API페이로드 내에 대상 스키마의 ID를 제공합니다.
Target 데이터 세트를 만드는 방법에 대한 자세한 단계는 의 자습서를 참조하십시오. api를 사용하여 데이터 세트 만들기.
대상 연결은 수집된 데이터가 들어오는 대상에 대한 연결을 나타냅니다. 대상 연결을 만들려면 데이터 레이크와 연결된 고정 연결 사양 ID를 제공해야 합니다. 이 연결 사양 ID는 c604ff05-7f1a-43c0-8e18-33bf874cb11c
.
이제 타겟 스키마에 대한 고유 식별자, 타겟 데이터 세트 및 데이터 레이크에 대한 연결 사양 ID가 있습니다. 사용 Flow Service API를 사용하면 인바운드 소스 데이터를 포함할 데이터 세트와 함께 이러한 식별자를 지정하여 타겟 연결을 만들 수 있습니다.
API 형식
POST /targetConnections
요청
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": "Target Connection for protocols",
"description": "Target Connection for protocols",
"data": {
"format": "parquet_xdm",
"schema": {
"id": "https://ns.adobe.com/{TENANT_ID}/schemas/e669d7aba5a02f294fafb7b269af25f7cd4a66ce59193545",
"version" "application/vnd.adobe.xed-full+json;version=1"
}
},
"params": {
"dataSetId": "5e8a55ca53662c18af37a83a"
},
"connectionSpec": {
"id": "c604ff05-7f1a-43c0-8e18-33bf874cb11c",
"version": "1.0"
}
}'
속성 | 설명 |
---|---|
data.schema.id |
다음 $id 대상 XDM 스키마. |
params.dataSetId |
대상 데이터 세트의 ID입니다. |
connectionSpec.id |
데이터 레이크에 연결하는 데 사용되는 연결 사양 ID입니다. 이 ID는 c604ff05-7f1a-43c0-8e18-33bf874cb11c . |
응답
성공적인 응답은 새 타겟 연결의 고유 식별자( )를 반환합니다.id
). 이 값은 데이터 흐름을 만들기 위해 이후 단계에서 필요합니다.
{
"id": "576d5ecf-f114-4587-ad5e-cff1144587f4",
"etag": "\"13013506-0000-0200-0000-5e8a56d80000\""
}
소스 데이터를 타겟 데이터 세트에 수집하려면 먼저 타겟 데이터 세트가 준수하는 타겟 스키마에 매핑해야 합니다.
POST 매핑 세트를 만들려면 mappingSets
의 엔드포인트 Data Prep API target XDM 스키마를 제공하는 동안 $id
만들려는 매핑 세트의 세부 정보.
API 형식
POST /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/e669d7aba5a02f294fafb7b269af25f7cd4a66ce59193545",
"xdmVersion": "1.0",
"id": null,
"mappings": [
{
"destinationXdmPath": "_id",
"sourceAttribute": "OrderID",
"identity": false,
"identityGroup": null,
"namespaceCode": null,
"version": 0
},
{
"destinationXdmPath": "_id",
"sourceAttribute": "CustomerID",
"identity": false,
"identityGroup": null,
"namespaceCode": null,
"version": 0
},
{
"destinationXdmPath": "_id",
"sourceAttribute": "EmployeeID",
"identity": false,
"identityGroup": null,
"namespaceCode": null,
"version": 0
},
{
"destinationXdmPath": "createdByBatchID",
"sourceAttribute": "OrderDate",
"identity": false,
"identityGroup": null,
"namespaceCode": null,
"version": 0
}
]
}'
속성 | 설명 |
---|---|
xdmSchema |
다음 $id 대상 XDM 스키마. |
응답
성공적인 응답은 고유한 식별자( )를 포함하여 새로 생성된 매핑의 세부 정보를 반환합니다.id
). 이 ID는 데이터 흐름을 만들기 위해 이후 단계에서 필요합니다.
{
"id": "37409d3017e24a3eb4a2dc21020f7a5b",
"version": 0,
"createdDate": 1586124873209,
"modifiedDate": 1586124873209,
"createdBy": "{CREATED_BY}",
"modifiedBy": "{MODIFIED_BY}"
}
데이터 흐름은 소스에서 데이터를 수집하고 플랫폼으로 가져오는 역할을 합니다. 데이터 흐름을 만들려면 먼저 프로토콜 응용 프로그램에서 데이터 수집을 담당하는 데이터 흐름 사양을 구해야 합니다.
API 형식
GET /flowSpecs?property=name=="CRMToAEP"
요청
curl -X GET \
'https://platform.adobe.io/data/foundation/flowservice/flowSpecs?property=name=="CRMToAEP"' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
응답
성공적인 응답은 소스에서 플랫폼으로 데이터를 가져오는 역할을 하는 데이터 흐름 사양의 세부 정보를 반환합니다. 응답에는 고유한 흐름 사양이 포함됩니다 id
새 데이터 흐름을 만드는 데 필요합니다.
간결성을 위해 아래의 JSON 응답 페이로드가 숨겨집니다. 응답 페이로드를 보려면 "페이로드"를 선택합니다.
{
"id": "14518937-270c-4525-bdec-c2ba7cce3860",
"name": "CRMToAEP",
"providerId": "0ed90a81-07f4-4586-8190-b40eccef1c5a",
"version": "1.0",
"attributes": {
"isSourceFlow": true,
"flacValidationSupported": true,
"frequency": "batch",
"notification": {
"category": "sources",
"flowRun": {
"enabled": true
}
}
},
"sourceConnectionSpecIds": [
"3416976c-a9ca-4bba-901a-1f08f66978ff",
"38ad80fe-8b06-4938-94f4-d4ee80266b07",
"d771e9c1-4f26-40dc-8617-ce58c4b53702",
"3c9b37f8-13a6-43d8-bad3-b863b941fedd",
"cc6a4487-9e91-433e-a3a3-9cf6626c1806",
"3000eb99-cd47-43f3-827c-43caf170f015",
"26d738e0-8963-47ea-aadf-c60de735468a",
"74a1c565-4e59-48d7-9d67-7c03b8a13137",
"cfc0fee1-7dc0-40ef-b73e-d8b134c436f5",
"4f63aa36-bd48-4e33-bb83-49fbcd11c708",
"cb66ab34-8619-49cb-96d1-39b37ede86ea",
"eb13cb25-47ab-407f-ba89-c0125281c563",
"1f372ff9-38a4-4492-96f5-b9a4e4bd00ec",
"37b6bf40-d318-4655-90be-5cd6f65d334b",
"a49bcc7d-8038-43af-b1e4-5a7a089a7d79",
"221c7626-58f6-4eec-8ee2-042b0226f03b",
"a8b6a1a4-5735-42b4-952c-85dce0ac38b5",
"6a8d82bc-1caf-45d1-908d-cadabc9d63a6",
"aac9bbd4-6c01-46ce-b47e-51c6f0f6db3f",
"8e6b41a8-d998-4545-ad7d-c6a9fff406c3",
"ecde33f2-c56f-46cc-bdea-ad151c16cd69",
"102706fb-a5cd-42ee-afe0-bc42f017ff43",
"09182899-b429-40c9-a15a-bf3ddbc8ced7",
"0479cc14-7651-4354-b233-7480606c2ac3",
"d6b52d86-f0f8-475f-89d4-ce54c8527328",
"a8f4d393-1a6b-43f3-931f-91a16ed857f4",
"1fe283f6-9bec-11ea-bb37-0242ac130002",
"fcad62f3-09b0-41d3-be11-449d5a621b69",
"ea1c2a08-b722-11eb-8529-0242ac130003",
"35d6c4d8-c9a9-11eb-b8bc-0242ac130003",
"ff4274f2-c9a9-11eb-b8bc-0242ac130003",
"ba5126ec-c9ac-11eb-b8bc-0242ac130003",
"b2e08744-4f1a-40ce-af30-7abac3e23cf3",
"929e4450-0237-4ed2-9404-b7e1e0a00309",
"2acf109f-9b66-4d5e-bc18-ebb2adcff8d5",
"2fa8af9c-2d1a-43ea-a253-f00a00c74412"
],
"targetConnectionSpecIds": [
"c604ff05-7f1a-43c0-8e18-33bf874cb11c"
],
"permissionsInfo": {
"view": [
{
"@type": "lowLevel",
"name": "EnterpriseSource",
"permissions": [
"read"
]
}
],
"manage": [
{
"@type": "lowLevel",
"name": "EnterpriseSource",
"permissions": [
"write"
]
}
]
},
"optionSpec": {
"name": "OptionSpec",
"spec": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"errorDiagnosticsEnabled": {
"title": "Error diagnostics.",
"description": "Flag to enable detailed and sample error diagnostics summary.",
"type": "boolean",
"default": false
},
"partialIngestionPercent": {
"title": "Partial ingestion threshold.",
"description": "Percentage which defines the threshold of errors allowed before the run is marked as failed.",
"type": "number",
"exclusiveMinimum": 0
}
}
}
},
"scheduleSpec": {
"name": "PeriodicSchedule",
"type": "Periodic",
"spec": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"startTime": {
"description": "epoch time",
"type": "integer"
},
"frequency": {
"type": "string",
"enum": [
"once",
"minute",
"hour",
"day",
"week"
]
},
"interval": {
"type": "integer"
},
"backfill": {
"type": "boolean",
"default": true
}
},
"required": [
"startTime",
"frequency"
],
"if": {
"properties": {
"frequency": {
"const": "once"
}
}
},
"then": {
"allOf": [
{
"not": {
"required": [
"interval"
]
}
},
{
"not": {
"required": [
"backfill"
]
}
}
]
},
"else": {
"required": [
"interval"
],
"if": {
"properties": {
"frequency": {
"const": "minute"
}
}
},
"then": {
"properties": {
"interval": {
"minimum": 15
}
}
},
"else": {
"properties": {
"interval": {
"minimum": 1
}
}
}
}
}
},
"transformationSpec": [
{
"name": "Copy",
"spec": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"deltaColumn": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"dateFormat": {
"type": "string"
},
"timezone": {
"type": "string"
}
},
"required": [
"name"
]
}
},
"required": [
"deltaColumn"
]
}
},
{
"name": "Mapping",
"spec": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "defines various params required for different mapping from source to target",
"properties": {
"mappingId": {
"type": "string"
},
"mappingVersion": {
"type": "string"
}
}
}
}
],
"runSpec": {
"name": "ProviderParams",
"spec": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "defines various params required for creating flow run.",
"properties": {
"startTime": {
"type": "integer",
"description": "An integer that defines the start time of the run. The value is represented in Unix epoch time."
},
"windowStartTime": {
"type": "integer",
"description": "An integer that defines the start time of the window against which data is to be pulled. The value is represented in Unix epoch time."
},
"windowEndTime": {
"type": "integer",
"description": "An integer that defines the end time of the window against which data is to be pulled. The value is represented in Unix epoch time."
},
"deltaColumn": {
"type": "object",
"description": "The delta column is required to partition the data and separate newly ingested data from historic data.",
"properties": {
"name": {
"type": "string"
},
"dateFormat": {
"type": "string"
},
"timezone": {
"type": "string"
}
},
"required": [
"name"
]
}
},
"required": [
"startTime",
"windowStartTime",
"windowEndTime",
"deltaColumn"
]
}
}
}
데이터 수집을 위한 마지막 단계는 데이터 흐름을 만드는 것입니다. 이 시점에서 다음 필수 값을 준비해야 합니다.
데이터 흐름은 소스에서 데이터를 예약하고 수집합니다. 페이로드 내에 이전에 언급된 값을 제공하면서 POST 요청을 수행하여 데이터 흐름을 만들 수 있습니다.
수집을 예약하려면 먼저 시작 시간 값을 에포크 시간(초)으로 설정해야 합니다. 그런 다음 빈도 값을 다음 다섯 가지 옵션 중 하나로 설정해야 합니다. once
, minute
, hour
, day
, 또는 week
. 간격 값은 두 개의 연속 수집 사이의 기간을 지정하며 1회 수집을 만들 때 간격을 설정할 필요가 없습니다. 다른 모든 주파수의 경우 간격 값이 보다 크거나 같게 설정되어야 합니다. 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": "Creating a dataflow for a protocols source",
"description": "Creating a dataflow for a protocols source",
"flowSpec": {
"id": "14518937-270c-4525-bdec-c2ba7cce3860",
"version": "1.0"
},
"sourceConnectionIds": [
"0a768941-ddfb-499d-b689-41ddfbf99db0"
],
"targetConnectionIds": [
"576d5ecf-f114-4587-ad5e-cff1144587f4"
],
"transformations": [
{
"name": "Copy",
"params": {
"deltaColumn": {
"name": "updatedAt",
"dateFormat": "YYYY-MM-DD",
"timezone": "UTC"
}
}
},
{
"name": "Mapping",
"params": {
"mappingId": "7409d3017e24a3eb4a2dc21020f7a5b",
"mappingVersion": 0
}
}
],
"scheduleParams": {
"startTime": "1567411548",
"frequency":"minute",
"interval":"30"
}
}'
속성 | 설명 |
---|---|
flowSpec.id |
다음 흐름 사양 ID 이전 단계에서 검색되었습니다. |
sourceConnectionIds |
다음 소스 연결 ID 이전 단계에서 검색되었습니다. |
targetConnectionIds |
다음 대상 연결 ID 이전 단계에서 검색되었습니다. |
transformations.params.mappingId |
다음 매핑 ID 이전 단계에서 검색되었습니다. |
transformations.params.deltaColum |
새 데이터와 기존 데이터를 구분하는 데 사용되는 지정된 열입니다. 증분 데이터는 선택한 열의 타임스탬프를 기반으로 수집됩니다. 에 지원되는 형식 deltaColumn 일반 OData 사용 시 yyyy-MM-ddTHH:mm:ssZ . |
transformations.params.mappingId |
데이터베이스와 연계된 매핑 ID. |
scheduleParams.startTime |
epoch 시간 내 데이터 흐름의 시작 시간입니다. |
scheduleParams.frequency |
데이터 흐름이 데이터를 수집하는 빈도입니다. 허용되는 값은 다음과 같습니다. once , minute , hour , day , 또는 week . |
scheduleParams.interval |
간격은 두 개의 연속 흐름 실행 사이의 기간을 지정합니다. 간격 값은 0이 아닌 정수여야 합니다. 빈도를 로 설정하면 간격이 필요하지 않습니다. once 다음보다 크거나 같아야 합니다. 15 다른 빈도 값의 경우. |
응답
성공적인 응답은 ID를 반환합니다 id
새로 생성된 데이터 흐름의
{
"id": "8256cfb4-17e6-432c-a469-6aedafb16cd5",
"etag": "\"04004fe9-0000-0200-0000-5ebc4c8b0000\""
}
데이터 흐름이 만들어지면 데이터 흐름을 통해 수집되는 데이터를 모니터링하여 흐름 실행, 완료 상태 및 오류에 대한 정보를 볼 수 있습니다. 데이터 흐름을 모니터링하는 방법에 대한 자세한 내용은 api에서 데이터 흐름 모니터링
이 자습서에 따라 일정에 따라 프로토콜 응용 프로그램에서 데이터를 수집하는 소스 커넥터를 만들었습니다. 이제 다음과 같은 다운스트림 플랫폼 서비스에서 수신 데이터를 사용할 수 있습니다. Real-Time Customer Profile 및 Data Science Workspace. 자세한 내용은 다음 문서를 참조하십시오.