(Beta) 소스 연결 및 데이터 흐름 만들기 SugarCRM Events 흐름 서비스 API 사용
다음 튜토리얼에서는 다음을 만드는 단계를 설명합니다. SugarCRM Events 소스 연결 및 가져올 데이터 흐름 만들기 SugarCRM 를 사용하여 Adobe Experience Platform에 이벤트 데이터 보내기 Flow Service API.
시작하기
이 안내서를 사용하려면 Experience Platform의 다음 구성 요소에 대해 이해하고 있어야 합니다.
다음 섹션에서는 에 성공적으로 연결하기 위해 알아야 하는 추가 정보를 제공합니다 SugarCRM 사용 Flow Service API.
필요한 자격 증명 수집
연결하려면 SugarCRM Events 플랫폼에 다음 연결 속성에 대한 값을 제공해야 합니다.
host
developer.salesfusion.com
username
abc.def@example.com@sugarmarketdemo000.com
password
123456789
연결 SugarCRM Events 를 사용하여 플랫폼으로 Flow Service API
다음은 를 인증하기 위해 수행해야 하는 단계입니다. SugarCRM 소스, 소스 연결 만들기 및 데이터 흐름을 만들어 이벤트 데이터를 Experience Platform 상태로 만듭니다.
기본 연결을 만듭니다 base-connection
기본 연결은 소스의 인증 자격 증명, 연결의 현재 상태 및 고유한 기본 연결 ID를 포함하여 소스와 플랫폼 간에 정보를 유지합니다. 기본 연결 ID를 사용하면 소스 내에서 파일을 탐색 및 탐색하고 데이터 유형 및 형식에 대한 정보를 포함하여 수집할 특정 항목을 식별할 수 있습니다.
POST 기본 연결 ID를 만들려면 /connections
을(를) 제공하는 동안 엔드포인트 SugarCRM Events 요청 본문의 일부인 인증 자격 증명입니다.
API 형식
POST /connections
요청
다음 요청은에 대한 기본 연결을 만듭니다. SugarCRM Events:
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": "SugarCRM Events base connection",
"description": "Create a live inbound connection to your SugarCRM Events instance, to ingest both historic and scheduled data into Experience Platform",
"connectionSpec": {
"id": "59a4b493-a615-40f9-bd38-f823d0909a2b",
"version": "1.0"
},
"auth": {
"specName": "OAuth2 Refresh Code",
"params": {
"host": "developer.salesfusion.com",
"username": "{SUGARCRM_DEVELOPER_ACCOUNT_USERNAME}",
"password": "{SUGARCRM_DEVELOPER_ACCOUNT_PASSWORD}"
}
}
}'
name
description
connectionSpec.id
auth.specName
auth.params.host
auth.params.username
auth.params.password
응답
성공한 응답은 고유 연결 식별자를 포함하여 새로 만든 기본 연결을 반환합니다(id
). 이 ID는 다음 단계에서 소스의 파일 구조 및 콘텐츠를 탐색하는 데 필요합니다.
{
"id": "f5421911-6f6c-41c7-aafa-5d9d2ce51535",
"etag": "\"4d08164f-0000-0200-0000-6368b7bf0000\""
}
소스 탐색 explore
이전 단계에서 생성한 기본 연결 ID를 사용하여 GET 요청을 수행하여 파일 및 디렉터리를 탐색할 수 있습니다.
다음 호출을 사용하여 가져올 파일의 경로를 찾습니다 Platform:
API 형식
GET /connections/{BASE_CONNECTION_ID}/explore?objectType=rest&object={OBJECT}&fileType={FILE_TYPE}&preview={PREVIEW}&sourceParams={SOURCE_PARAMS}
소스의 파일 구조 및 컨텐츠를 탐색하기 위해 GET 요청을 수행할 때 아래 표에 나열된 쿼리 매개 변수를 포함해야 합니다.
{BASE_CONNECTION_ID}
objectType=rest
rest
.{OBJECT}
json
.fileType=json
json
는 유일하게 지원되는 파일 유형입니다.{PREVIEW}
{SOURCE_PARAMS}
{SOURCE_PARAMS}
, 전체 문자열을 base64에서 인코딩해야 합니다.SugarCRM Events 페이로드가 필요하지 않습니다. 값
{SOURCE_PARAMS}
다음으로 전달됨 {}
, base64로 인코딩되어 다음과 같습니다. e30=
아래와 같이 표시됩니다.요청
curl -X GET \
'https://platform.adobe.io/data/foundation/flowservice/connections/f5421911-6f6c-41c7-aafa-5d9d2ce51535/explore?objectType=rest&object=json&fileType=json&preview=true&sourceParams=e30=' \
-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}'
응답
성공한 응답은 쿼리된 파일의 구조를 반환합니다. 더 나은 프레젠테이션을 위해 일부 레코드가 제거되었습니다.
{
"format": "hierarchical",
"schema": {
"type": "object",
"properties": {
"next": {
"type": "string"
},
"page_number": {
"type": "integer",
"minimum": -9007199254740992,
"maximum": 9007199254740991
},
"previous": {},
"total_count": {
"type": "integer",
"minimum": -9007199254740992,
"maximum": 9007199254740991
},
"count": {
"type": "integer",
"minimum": -9007199254740992,
"maximum": 9007199254740991
},
"results": {
"type": "object",
"properties": {
"sessions": {
"type": "string"
},
"description": {
"type": "string"
},
"created_by": {
"type": "string"
},
"event_id": {
"type": "integer",
"minimum": -9007199254740992,
"maximum": 9007199254740991
},
"name": {
"type": "string"
},
"updated_by": {
"type": "string"
},
"updated_by_id": {
"type": "integer",
"minimum": -9007199254740992,
"maximum": 9007199254740991
},
"updated_date": {
"type": "string"
},
"created_date": {
"type": "string"
},
"created_by_id": {
"type": "integer",
"minimum": -9007199254740992,
"maximum": 9007199254740991
},
"event": {
"type": "string"
},
"folder_id": {
"type": "integer",
"minimum": -9007199254740992,
"maximum": 9007199254740991
},
"status": {
"type": "string"
}
}
},
"page_size": {
"type": "integer",
"minimum": -9007199254740992,
"maximum": 9007199254740991
}
}
},
"data": [
{
"next": "https://developer.salesfusion.com/api/2.0/events/?date_field=updated_date&page=2",
"page_number": 1,
"total_count": 532,
"count": 532,
"results": {
"event_id": 1,
"event": "https://developer.salesfusion.com/api/2.0/events/1/",
"sessions": "https://developer.salesfusion.com/api/2.0/events/1/sessions/",
"name": "Test",
"updated_date": "2022-08-30T11:20:11.813Z",
"updated_by_id": 59,
"updated_by": "https://developer.salesfusion.com/api/2.0/users/59/",
"created_date": "2022-08-28T23:40:11Z",
"created_by_id": 59,
"created_by": "https://developer.salesfusion.com/api/2.0/users/59/",
"status": "Draft",
"folder_id": 2
},
"page_size": 100
},
{
"next": "https://developer.salesfusion.com/api/2.0/events/?date_field=updated_date&page=2",
"page_number": 1,
"total_count": 532,
"count": 532,
"results": {
"event_id": 2,
"event": "https://developer.salesfusion.com/api/2.0/events/2/",
"sessions": "https://developer.salesfusion.com/api/2.0/events/2/sessions/",
"name": "Infy Event",
"description": "Test Event",
"updated_date": "2022-09-15T16:26:43.697Z",
"updated_by_id": 59,
"updated_by": "https://developer.salesfusion.com/api/2.0/users/59/",
"created_date": "2022-09-27T23:40:11Z",
"created_by_id": 59,
"created_by": "https://developer.salesfusion.com/api/2.0/users/59/",
"status": "Active",
"folder_id": 2
},
"page_size": 100
},
{
"next": "https://developer.salesfusion.com/api/2.0/events/?date_field=updated_date&page=2",
"page_number": 1,
"total_count": 532,
"count": 532,
"results": {
"event_id": 3,
"event": "https://developer.salesfusion.com/api/2.0/events/3/",
"sessions": "https://developer.salesfusion.com/api/2.0/events/3/sessions/",
"name": "Infy Workshop 1",
"updated_date": "2022-10-11T18:12:28.767Z",
"updated_by_id": 59,
"updated_by": "https://developer.salesfusion.com/api/2.0/users/59/",
"created_date": "2022-09-14T23:40:11Z",
"created_by_id": 59,
"created_by": "https://developer.salesfusion.com/api/2.0/users/59/",
"status": "Active",
"folder_id": 2
},
"page_size": 100
}
]
}
소스 연결 만들기 source-connection
에 POST 요청을 하여 소스 연결을 만들 수 있습니다. Flow Service API. 소스 연결은 연결 ID, 소스 데이터 파일에 대한 경로 및 연결 사양 ID로 구성됩니다.
API 형식
POST /sourceConnections
요청
다음 요청은에 대한 소스 연결을 만듭니다. SugarCRM Events:
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": "SugarCRM Source Connection",
"description": "SugarCRM Source Connection",
"baseConnectionId": "f5421911-6f6c-41c7-aafa-5d9d2ce51535",
"connectionSpec": {
"id": "63d2b27b-69a5-45c9-a7fe-78148a25de3c",
"version": "1.0"
},
"data": {
"format": "json"
},
"params": {
}
}'
name
description
baseConnectionId
connectionSpec.id
data.format
json
.응답
성공적인 응답은 고유 식별자()를 반환합니다.id
)을 참조하십시오. 이 ID는 데이터 흐름을 만들기 위해 이후 단계에서 필요합니다.
{
"id": "ffac1ae1-c137-4133-9f8d-0279468c11c9",
"etag": "\"ed05abc3-0000-0200-0000-6368b3280000\""
}
대상 XDM 스키마 만들기 target-schema
소스 데이터를 플랫폼에서 사용하려면 타겟 스키마를 만들어 필요에 따라 소스 데이터를 구조화해야 합니다. 그런 다음 대상 스키마를 사용하여 소스 데이터가 포함된 Platform 데이터 세트를 만듭니다.
에 대한 POST 요청을 수행하여 대상 XDM 스키마를 생성할 수 있습니다. 스키마 레지스트리 API.
대상 XDM 스키마를 만드는 방법에 대한 자세한 단계는 다음 자습서를 참조하십시오. api를 사용하여 스키마 만들기.
타겟 데이터 세트 만들기 target-dataset
에 대한 POST 요청을 수행하여 타겟 데이터 세트를 생성할 수 있습니다. 카탈로그 서비스 API페이로드 내에 대상 스키마의 ID를 제공합니다.
Target 데이터 세트를 만드는 방법에 대한 자세한 단계는 의 자습서를 참조하십시오. api를 사용하여 데이터 세트 만들기.
대상 연결 만들기 target-connection
대상 연결은 수집된 데이터를 저장할 대상에 대한 연결을 나타냅니다. 대상 연결을 만들려면 데이터 레이크에 해당하는 고정 연결 사양 ID를 제공해야 합니다. 이 ID는 c604ff05-7f1a-43c0-8e18-33bf874cb11c
.
이제 대상 스키마에 대한 고유 식별자, 대상 데이터 세트 및 데이터 레이크에 대한 연결 사양 ID가 있습니다. 이러한 식별자를 사용하여 다음을 사용하여 대상 연결을 만들 수 있습니다. Flow Service 인바운드 소스 데이터를 포함할 데이터 세트를 지정하는 API입니다.
API 형식
POST /targetConnections
요청
다음 요청은에 대한 대상 연결을 만듭니다. SugarCRM Events:
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": "SugarCRM Target Connection Generic Rest",
"description": "SugarCRM Target Connection Generic Rest",
"connectionSpec": {
"id": "63d2b27b-69a5-45c9-a7fe-78148a25de3c",
"version": "1.0"
},
"data": {
"format": "parquet_xdm",
"schema": {
"id": "https://ns.adobe.com/{TENANT_ID}/schemas/b156e6f818f923e048199173c45e55e20fd2487f5eb03d22",
"version": "1.22"
}
},
"params": {
"dataSetId": "6365389d1d37d01c077a81da"
}
}'
name
description
connectionSpec.id
6b137bf6-d2a0-48c8-914b-d50f4942eb85
.data.format
params.dataSetId
응답
성공적인 응답은 새 타겟 연결의 고유 식별자( )를 반환합니다.id
). 이 ID는 이후 단계에서 필수입니다.
{
"id": "dfe9113e-be98-4d63-80a9-f41761721049",
"etag": "\"84050267-0000-0200-0000-6368b3640000\""
}
매핑 만들기 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 '{
"outputSchema": {
"schemaRef": {
"id": "https://ns.adobe.com/{TENANT_ID}/schemas/b156e6f818f923e048199173c45e55e20fd2487f5eb03d22",
"contentType": "application/vnd.adobe.xed-full+json;version=1"
}
},
"mappings": [
{
"sourceType": "ATTRIBUTE",
"source": "results.created_by",
"destination": "_extconndev.created_by"
},
{
"sourceType": "ATTRIBUTE",
"source": "results.created_by_id",
"destination": "_extconndev.created_by_id"
},
{
"sourceType": "ATTRIBUTE",
"source": "results.created_date",
"destination": "_extconndev.created_date"
},
{
"sourceType": "ATTRIBUTE",
"source": "results.name",
"destination": "_extconndev.name_event"
},
{
"sourceType": "ATTRIBUTE",
"source": "results.event_id",
"destination": "_extconndev.id_event"
},
{
"sourceType": "ATTRIBUTE",
"source": "results.event_id",
"destination": "_id"
},
{
"sourceType": "ATTRIBUTE",
"source": "results.sessions",
"destination": "_extconndev.sessions"
},
{
"sourceType": "ATTRIBUTE",
"source": "results.updated_by",
"destination": "_extconndev.updated_by"
},
{
"sourceType": "ATTRIBUTE",
"source": "results.updated_by_id",
"destination": "_extconndev.updated_by_id"
},
{
"sourceType": "ATTRIBUTE",
"source": "results.updated_date",
"destination": "_extconndev.updated_date"
},
{
"sourceType": "ATTRIBUTE",
"source": "results.updated_date",
"destination": "timestamp"
},
{
"sourceType": "ATTRIBUTE",
"source": "results.event",
"destination": "_extconndev.event"
},
{
"sourceType": "ATTRIBUTE",
"source": "results.description",
"destination": "_extconndev.description"
},
{
"sourceType": "ATTRIBUTE",
"source": "results.folder_id",
"destination": "_extconndev.folder_id"
},
{
"sourceType": "ATTRIBUTE",
"source": "results.status",
"destination": "_extconndev.status"
}
]
}'
outputSchema.schemaRef.id
mappings.sourceType
mappings.source
mappings.destination
응답
성공적인 응답은 고유한 식별자( )를 포함하여 새로 생성된 매핑의 세부 정보를 반환합니다.id
). 이 값은 데이터 흐름을 만들기 위해 이후 단계에서 필요합니다.
{
"id": "d3845beaceeb49669228973f5f937f89",
"version": 0,
"createdDate": 1597784069368,
"modifiedDate": 1597784069368,
"createdBy": "{CREATED_BY}",
"modifiedBy": "{MODIFIED_BY}"
}
플로우 만들기 flow
데이터 가져오기를 위한 마지막 단계 SugarCRM Events 를 플랫폼으로 가져와서 데이터 흐름을 만듭니다. 이제 다음 필수 값이 준비되었습니다.
데이터 흐름은 소스에서 데이터를 예약하고 수집합니다. 페이로드 내에 이전에 언급된 값을 제공하면서 POST 요청을 수행하여 데이터 흐름을 만들 수 있습니다.
수집을 예약하려면 먼저 시작 시간 값을 에포크 시간(초)으로 설정해야 합니다. 그런 다음 빈도 값을 다음 중 하나로 설정해야 합니다 hour
또는 day
. 간격 값은 두 개의 연속 수집 사이의 기간을 지정합니다. 간격 값은 로 설정해야 합니다. 1
또는 24
다음에 종속 scheduleParams.frequency
다음 중 하나를 선택합니다. hour
또는 day
.
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": "SugarCRM Connector Description Flow Generic Rest",
"description": "SugarCRM Connector Description Flow Generic Rest",
"flowSpec": {
"id": "6499120c-0b15-42dc-936e-847ea3c24d72",
"version": "1.0"
},
"sourceConnectionIds": [
"8f1fc72a-f562-4a1d-8597-85b5ca1b1cd3"
],
"targetConnectionIds": [
"6b137bf6-d2a0-48c8-914b-d50f4942eb85"
],
"transformations": [
{
"name": "Mapping",
"params": {
"mappingId": "d3845beaceeb49669228973f5f937f89",
"mappingVersion": "0"
}
}
],
"scheduleParams": {
"startTime": "1625040887",
"frequency": "hour",
"interval": 1
}
}'
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
hour
또는 day
.scheduleParams.interval
1
또는 24
다음에 종속 scheduleParams.frequency
다음 중 하나를 선택합니다. hour
또는 day
.응답
성공적인 응답은 ID( )를 반환합니다.id
)을 참조하십시오. 이 ID를 사용하여 데이터 흐름을 모니터링, 업데이트 또는 삭제할 수 있습니다.
{
"id": "fcd16140-81b4-422a-8f9a-eaa92796c4f4",
"etag": "\"9200a171-0000-0200-0000-6368c1da0000\""
}
부록
다음 섹션에서는 데이터 흐름을 모니터링, 업데이트 및 삭제할 수 있는 단계에 대해 설명합니다.
데이터 흐름 모니터링
데이터 흐름이 만들어지면 데이터 흐름을 통해 수집되는 데이터를 모니터링하여 흐름 실행, 완료 상태 및 오류에 대한 정보를 볼 수 있습니다. 전체 API 예제는 의 안내서를 참조하십시오. api를 사용하여 소스 데이터 흐름 모니터링.
데이터 흐름 업데이트
에 PATCH 요청을 하여 데이터 흐름의 이름, 설명, 실행 일정 및 관련 매핑 세트 등 세부 정보를 업데이트합니다. /flows
엔드포인트 Flow Service API, 데이터 흐름의 ID 제공. PATCH 요청을 할 때는 데이터 흐름의 고유한 값을 제공해야 합니다 etag
다음에서 If-Match
머리글입니다. 전체 API 예제는 의 안내서를 참조하십시오. api를 사용하여 소스 데이터 흐름 업데이트
계정 업데이트
에 대한 PATCH 요청을 수행하여 소스 계정의 이름, 설명 및 자격 증명을 업데이트합니다. Flow Service 기본 연결 ID를 쿼리 매개 변수로 제공하는 동안 API입니다. PATCH 요청을 할 때는 소스 계정의 고유 값을 제공해야 합니다 etag
다음에서 If-Match
머리글입니다. 전체 API 예제는 의 안내서를 참조하십시오. api를 사용하여 소스 계정 업데이트.
데이터 흐름 삭제
에 대한 DELETE 요청을 수행하여 데이터 흐름을 삭제합니다. Flow Service 쿼리 매개변수의 일부로 삭제할 데이터 흐름의 ID를 제공하는 동안 API입니다. 전체 API 예제는 의 안내서를 참조하십시오. api를 사용하여 데이터 흐름 삭제.
계정 삭제
에 대한 DELETE 요청을 수행하여 계정을 삭제합니다. Flow Service 삭제할 계정의 기본 연결 ID를 제공하는 동안 API입니다. 전체 API 예제는 의 안내서를 참조하십시오. api를 사용하여 소스 계정 삭제.