(測試版)建立源連接和資料流 SugarCRM Accounts & Contacts 使用流量服務API

注意

此 SugarCRM Accounts & Contacts 來源為測試版。 請參閱 來源概觀 以取得使用測試版標籤來源的詳細資訊。

以下教學課程會逐步引導您完成建立 SugarCRM Accounts & Contacts 源連接和建立資料流,以便 SugarCRM 帳戶和連絡人資料,使用 Flow Service API.

快速入門

本指南需要妥善了解下列Experience Platform元件:

  • 來源:Experience Platform可讓您從各種來源擷取資料,同時使用Platform服務來建構、加標籤及增強傳入資料。
  • 沙箱:Experience Platform提供可將單一Platform執行個體分割成個別虛擬環境的虛擬沙箱,以協助開發及改進數位體驗應用程式。

以下各節提供您需要了解的其他資訊,以便成功連接到 SugarCRM 使用 Flow Service API。

收集所需憑據

為了連接 SugarCRM Accounts & Contacts 若要使用Platform,您必須提供下列連線屬性的值:

憑據 說明 範例
host 源連接的SugarCRM API端點。 developer.salesfusion.com
username 您的SugarCRM開發人員帳戶使用者名稱。 abc.def@example.com@sugarmarketdemo000.com
password 您的SugarCRM開發人員帳戶密碼。 123456789

Connect SugarCRM Accounts & Contacts 到使用 Flow Service API

以下概述驗證您的 SugarCRM 源、建立源連接和建立資料流,以將帳戶和聯繫人資料Experience Platform。

建立基本連接

基本連接在源和平台之間保留資訊,包括源的驗證憑據、連接的當前狀態和唯一基本連接ID。 基本連線ID可讓您從來源探索和導覽檔案,並識別您要擷取的特定項目,包括其資料類型和格式的相關資訊。

若要建立基本連線ID,請向 /connections 端點提供 SugarCRM Accounts & Contacts 請求內文的驗證憑證。

API格式

POST /connections

要求

下列請求會為 SugarCRM Accounts & Contacts:

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 Accounts & Contacts base connection",
      "description": "Create a live inbound connection to your SugarCRM Accounts & Contacts 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 源的連接規範ID。 此ID可在您的來源註冊並透過 Flow Service API。
auth.specName 用於向平台驗證源的驗證類型。
auth.params.host SugarCRM API主機: developer.salesfusion.com
auth.params.username 您的SugarCRM開發人員帳戶使用者名稱。
auth.params.password 您的SugarCRM開發人員帳戶密碼。

回應

成功的響應返回新建的基本連接,包括其唯一連接標識符(id)。 在下一步中,瀏覽源的檔案結構和內容時需要此ID。

{
     "id": "f5421911-6f6c-41c7-aafa-5d9d2ce51535",
     "etag": "\"4d08164f-0000-0200-0000-6368b7bf0000\""
}

探索源

使用在上一步中生成的基本連接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} 上一步驟中產生的基本連線ID。
objectType=rest 要瀏覽的對象類型。 目前,此值一律設為 rest.
{OBJECT} 只有在查看特定目錄時,才需要此參數。 其值表示要瀏覽的目錄的路徑。 對於此來源,值會是 json.
fileType=json 要帶入Platform的檔案的檔案類型。 目前, json 是唯一支援的檔案類型。
{PREVIEW} 一個布林值,定義連接的內容是否支援預覽。
{SOURCE_PARAMS} 定義要帶入Platform的源檔案的參數。 要檢索接受的格式類型,請執行以下操作 {SOURCE_PARAMS},則必須對base64中的整個字串進行編碼。
SugarCRM Accounts & Contacts 支援多個API。 視您使用的物件類型而定,請傳遞下列其中一個:
  • accounts :貴組織與其有關係的公司。
  • contacts :您的組織與其有既定關係的個人。

此 SugarCRM Accounts & Contacts 支援多個API。 根據您運用要傳送請求的物件類型,如下所示:

要求

針對 SugarCRM 帳戶API的值 {SOURCE_PARAMS} 傳遞為 {"object_type":"accounts"}. 在base64中編碼時,相當於 eyJvYmplY3RfdHlwZSI6ImFjY291bnRzIn0= 如下所示。

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=eyJvYmplY3RfdHlwZSI6ImFjY291bnRzIn0=' \
  -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}'

針對 SugarCRM 聯繫人API的值 {SOURCE_PARAMS} 傳遞為 {"object_type":"contacts"}. 在base64中編碼時相當於 eyJvYmplY3RfdHlwZSI6ImNvbnRhY3RzIn0= 如下所示。

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=eyJvYmplY3RfdHlwZSI6ImNvbnRhY3RzIn0=' \
  -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": {
                    "owner": {
                        "type": "string"
                    },
                    "key_account": {
                        "type": "boolean"
                    },
                    "owner_id": {
                        "type": "integer",
                        "minimum": -9007199254740992,
                        "maximum": 9007199254740991
                    },
                    "custom_score_field": {
                        "type": "string"
                    },
                    "created_by": {
                        "type": "string"
                    },
                    "billing_city": {
                        "type": "string"
                    },
                    "account_id": {
                        "type": "integer",
                        "minimum": -9007199254740992,
                        "maximum": 9007199254740991
                    },
                    "phone": {
                        "type": "string"
                    },
                    "account_name": {
                        "type": "string"
                    },
                    "updated_by": {
                        "type": "string"
                    },
                    "updated_by_id": {
                        "type": "integer",
                        "minimum": -9007199254740992,
                        "maximum": 9007199254740991
                    },
                    "created_date": {
                        "type": "string"
                    },
                    "updated_date": {
                        "type": "string"
                    },
                    "created_by_id": {
                        "type": "integer",
                        "minimum": -9007199254740992,
                        "maximum": 9007199254740991
                    },
                    "account_score": {
                        "type": "integer",
                        "minimum": -9007199254740992,
                        "maximum": 9007199254740991
                    },
                    "account": {
                        "type": "string"
                    },
                    "contacts": {
                        "type": "string"
                    }
                }
            },
            "page_size": {
                "type": "integer",
                "minimum": -9007199254740992,
                "maximum": 9007199254740991
            }
        }
    },
    "data": [
        {
            "next": "https://developer.salesfusion.com/api/2.0/accounts/?date_field=updated_date&page=2",
            "page_number": 1,
            "total_count": 101148,
            "count": 101148,
            "results": {
                "account_id": 1,
                "account": "https://developer.salesfusion.com/api/2.0/accounts/1/",
                "account_name": "No Company",
                "owner_id": 1,
                "owner": "https://developer.salesfusion.com/api/2.0/users/1/",
                "created_date": "2022-06-22T23:35:00Z",
                "created_by": "https://developer.salesfusion.com/api/2.0/users/1/",
                "updated_date": "2019-08-29T15:18:00Z",
                "updated_by": "https://developer.salesfusion.com/api/2.0/users/1/",
                "contacts": "https://developer.salesfusion.com/api/2.0/accounts/1/contacts/",
                "created_by_id": 1,
                "updated_by_id": 1,
                "custom_score_field": "0",
                "account_score": 0,
                "key_account": false
            },
            "page_size": 100
        },
        {
            "next": "https://developer.salesfusion.com/api/2.0/accounts/?date_field=updated_date&page=2",
            "page_number": 1,
            "total_count": 101148,
            "count": 101148,
            "results": {
                "account_id": 2,
                "account": "https://developer.salesfusion.com/api/2.0/accounts/2/",
                "account_name": "360 Vacations",
                "owner_id": 45,
                "owner": "https://developer.salesfusion.com/api/2.0/users/45/",
                "phone": "+1 - 384 - 735 - 3844",
                "created_date": "2022-09-22T23:35:00Z",
                "created_by": "https://developer.salesfusion.com/api/2.0/users/45/",
                "updated_date": "2022-02-03T21:55:00Z",
                "updated_by": "https://developer.salesfusion.com/api/2.0/users/45/",
                "billing_city": "New York City",
                "contacts": "https://developer.salesfusion.com/api/2.0/accounts/2/contacts/",
                "created_by_id": 45,
                "updated_by_id": 45,
                "custom_score_field": "0",
                "account_score": 0,
                "key_account": false
            },
            "page_size": 100
        },
        {
            "next": "https://developer.salesfusion.com/api/2.0/accounts/?date_field=updated_date&page=2",
            "page_number": 1,
            "total_count": 101148,
            "count": 101148,
            "results": {
                "account_id": 50,
                "account": "https://developer.salesfusion.com/api/2.0/accounts/50/",
                "account_name": "Waverly Trading House",
                "owner_id": 40,
                "owner": "https://developer.salesfusion.com/api/2.0/users/40/",
                "phone": "+1 - 964 - 226 - 4552",
                "created_date": "2022-09-18T23:35:00Z",
                "created_by": "https://developer.salesfusion.com/api/2.0/users/40/",
                "updated_date": "2022-02-03T21:55:00Z",
                "updated_by": "https://developer.salesfusion.com/api/2.0/users/40/",
                "billing_city": "Minneapolis",
                "contacts": "https://developer.salesfusion.com/api/2.0/accounts/50/contacts/",
                "created_by_id": 40,
                "updated_by_id": 40,
                "custom_score_field": "0",
                "account_score": 0,
                "key_account": false
            },
            "page_size": 100
        }
    ]
}
{
    "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": {
                    "opt_out": {
                        "type": "string"
                    },
                    "custom_score_field": {
                        "type": "string"
                    },
                    "contact_id": {
                        "type": "integer",
                        "minimum": -9007199254740992,
                        "maximum": 9007199254740991
                    },
                    "title": {
                        "type": "string"
                    },
                    "deleted_date": {},
                    "contact": {
                        "type": "string"
                    },
                    "account_name": {
                        "type": "string"
                    },
                    "first_name": {
                        "type": "string"
                    },
                    "del_date": {},
                    "email": {
                        "type": "string"
                    },
                    "delivered_date": {},
                    "owner": {
                        "type": "string"
                    },
                    "owner_name": {
                        "type": "string"
                    },
                    "last_name": {
                        "type": "string"
                    },
                    "created_by": {
                        "type": "string"
                    },
                    "account_id": {
                        "type": "integer",
                        "minimum": -9007199254740992,
                        "maximum": 9007199254740991
                    },
                    "opt_out_date": {},
                    "phone": {
                        "type": "string"
                    },
                    "crm_id": {
                        "type": "string"
                    },
                    "crm_type": {
                        "type": "string"
                    },
                    "updated_by": {
                        "type": "string"
                    },
                    "updated_by_id": {
                        "type": "integer",
                        "minimum": -9007199254740992,
                        "maximum": 9007199254740991
                    },
                    "deliverability_status": {
                        "type": "integer",
                        "minimum": -9007199254740992,
                        "maximum": 9007199254740991
                    },
                    "deliverability_message": {},
                    "created_date": {
                        "type": "string"
                    },
                    "updated_date": {
                        "type": "string"
                    },
                    "created_by_id": {
                        "type": "integer",
                        "minimum": -9007199254740992,
                        "maximum": 9007199254740991
                    },
                    "account": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    }
                }
            },
            "page_size": {
                "type": "integer",
                "minimum": -9007199254740992,
                "maximum": 9007199254740991
            }
        }
    },
    "data": [
        {
            "next": "https://developer.salesfusion.com/api/2.0/contacts/?date_field=updated_date&page=2",
            "page_number": 1,
            "total_count": 135704,
            "count": 135704,
            "results": {
                "contact_id": 1,
                "contact": "https://developer.salesfusion.com/api/2.0/contacts/1/",
                "first_name": "Cynthia",
                "last_name": "Rose",
                "phone": "+1 - 000 - 000 - 000",
                "email": "test.user@hotmail.com",
                "account_id": 10,
                "account_name": "Sunyvale Reporting Ltd",
                "account": "https://developer.salesfusion.com/api/2.0/accounts/10/",
                "owner_name": "Sarah Smith",
                "owner": "https://developer.salesfusion.com/api/2.0/users/41/",
                "created_date": "2022-06-23T23:35:00Z",
                "created_by": "https://developer.salesfusion.com/api/2.0/users/41/",
                "updated_date": "2022-02-03T21:55:00Z",
                "updated_by": "https://developer.salesfusion.com/api/2.0/users/41/",
                "created_by_id": 41,
                "updated_by_id": 41,
                "crm_id": "f53c3982-84ea-11ec-874a-06a1e215b98e",
                "opt_out": "N",
                "crm_type": "Lead",
                "status": "Assigned",
                "title": "Director Operations",
                "custom_score_field": "0",
                "deliverability_status": 0
            },
            "page_size": 100
        },
        {
            "next": "https://developer.salesfusion.com/api/2.0/contacts/?date_field=updated_date&page=2",
            "page_number": 1,
            "total_count": 135704,
            "count": 135704,
            "results": {
                "contact_id": 2,
                "contact": "https://developer.salesfusion.com/api/2.0/contacts/2/",
                "email": "test.user@outlook.com",
                "created_date": "2022-06-21T23:35:00Z",
                "updated_date": "2022-02-03T21:55:00Z",
                "opt_out": "N",
                "crm_type": "Contact",
                "deliverability_status": 0
            },
            "page_size": 100
        },
        {
            "next": "https://developer.salesfusion.com/api/2.0/contacts/?date_field=updated_date&page=2",
            "page_number": 1,
            "total_count": 135704,
            "count": 135704,
            "results": {
                "contact_id": 3,
                "contact": "https://developer.salesfusion.com/api/2.0/contacts/3/",
                "first_name": "Jonathan",
                "last_name": "Ryan",
                "phone": "+1 - 000 - 000 - 0000",
                "email": "test.user@yahoo.com",
                "account_id": 52,
                "account_name": "Q3 ARVRO III PR",
                "account": "https://developer.salesfusion.com/api/2.0/accounts/52/",
                "owner_name": "Max Jensen",
                "owner": "https://developer.salesfusion.com/api/2.0/users/45/",
                "created_date": "2022-07-02T23:35:00Z",
                "created_by": "https://developer.salesfusion.com/api/2.0/users/45/",
                "updated_date": "2022-02-03T21:55:00Z",
                "updated_by": "https://developer.salesfusion.com/api/2.0/users/45/",
                "created_by_id": 45,
                "updated_by_id": 45,
                "crm_id": "f54a1840-84ea-11ec-9546-06a1e215b98e",
                "opt_out": "N",
                "crm_type": "Lead",
                "status": "New",
                "title": "Director Sales",
                "custom_score_field": "0",
                "deliverability_status": 0
            },
            "page_size": 100
    ]
}

建立源連接

您可以透過向 Flow Service API。 源連接由連接ID、源資料檔案的路徑和連接規範ID組成。

API格式

POST /sourceConnections

要求

以下請求將建立源連接 SugarCRM Accounts & Contacts:

根據您正在利用的對象類型,從以下頁簽中選擇:

針對 SugarCRM 帳戶API object_type 屬性值應為 accounts.

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": {
          "object_type": "accounts",
          "path": "accounts"
      }
  }'

針對 SugarCRM 聯繫人API object_type 屬性值應為 contacts.

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": {
          "object_type": "contacts",
          "path": "contacts"
      }
  }'
屬性 說明
name 源連接的名稱。 請確保源連接的名稱是描述性的,因為您可以使用此名稱查找有關源連接的資訊。
description 可包含的選用值,用於提供來源連線的詳細資訊。
baseConnectionId 基本連接ID為 SugarCRM Accounts & Contacts. 此ID是在先前的步驟中產生。
connectionSpec.id 與源對應的連接規範ID。
data.format 格式 SugarCRM Accounts & Contacts 您要擷取的資料。 目前,唯一支援的資料格式是 json.
object_type SugarCRM Accounts & Contacts 支援多個API。 視您使用的物件類型而定,請傳遞下列其中一個:
  • accounts :貴組織與其有關係的公司。
  • contacts :您的組織與其有既定關係的個人。
path 此值會與您選取的值相同 object_type.

回應

成功的回應會傳回唯一識別碼(id)。 在後續步驟中需要此ID才能建立資料流。

{
    "id": "8f1fc72a-f562-4a1d-8597-85b5ca1b1cd3",
    "etag": "\"ed05f1e1-0000-0200-0000-6368b8710000\""
}

建立目標XDM結構

為了在Platform中使用來源資料,必須建立目標架構,以根據您的需求來建構來源資料。 然後,目標架構會用來建立包含來源資料的Platform資料集。

您可以透過執行POST要求來建立目標XDM結構 結構註冊表API.

如需建立Target XDM結構的詳細步驟,請參閱 使用API建立結構.

建立目標資料集

目標資料集的建立方式,是透過對 目錄服務API,提供裝載中目標架構的ID。

如需如何建立目標資料集的詳細步驟,請參閱 使用API建立資料集.

建立目標連線

目標連線代表要儲存所擷取資料的目的地連線。 要建立目標連接,必須提供與資料庫對應的固定連接規範ID。 此ID為: c604ff05-7f1a-43c0-8e18-33bf874cb11c.

您現在擁有目標架構、目標資料集以及資料湖的連線規格ID的唯一識別碼。 使用這些識別碼,您可以使用 Flow Service API,指定包含傳入來源資料的資料集。

API格式

POST /targetConnections

要求

下列請求會為 SugarCRM Accounts & Contacts:

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 與資料湖對應的連接規範ID。 此固定ID為: 6b137bf6-d2a0-48c8-914b-d50f4942eb85.
data.format 格式 SugarCRM Accounts & Contacts 您要擷取的資料。
params.dataSetId 上一步驟中擷取的目標資料集ID。

回應

成功的回應會傳回新目標連線的唯一識別碼(id)。 後續步驟需要此ID。

{
    "id": "6b137bf6-d2a0-48c8-914b-d50f4942eb85",
    "etag": "\"8405a268-0000-0200-0000-6368b8c30000\""
}

建立對應

若要將來源資料內嵌至目標資料集,必須先將其對應至目標資料集所遵守的目標架構。 這是透過執行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.account",
          "destination": "_extconndev.account"
      },
      {
          "sourceType": "ATTRIBUTE",
          "source": "results.account_id",
          "destination": "_extconndev.account_id"
      },
      {
          "sourceType": "ATTRIBUTE",
          "source": "results.acount_name",
          "destination": "_extconndev.account_name"
      },
      {
          "sourceType": "ATTRIBUTE",
          "source": "results.account_score",
          "destination": "_extconndev.account_score"
      },
      {
          "sourceType": "ATTRIBUTE",
          "source": "results.billing_city",
          "destination": "_extconndev.billing_city"
      },
      {
          "sourceType": "ATTRIBUTE",
          "source": "results.contacts",
          "destination": "_extconndev.contacts"
      },
      {
          "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.custom_score_field",
          "destination": "_extconndev.custom_score_field"
      },
      {
          "sourceType": "ATTRIBUTE",
          "source": "results.key_account",
          "destination": "_extconndev.key_account"
      },
      {
          "sourceType": "ATTRIBUTE",
          "source": "results.owner",
          "destination": "_extconndev.owner"
      },
      {
          "sourceType": "ATTRIBUTE",
          "source": "results.owner_id",
          "destination": "_extconndev.owner_id"
      },
      {
          "sourceType": "ATTRIBUTE",
          "source": "results.phone",
          "destination": "_extconndev.phone_no"
      },
      {
          "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"
      }
      ]
  }'
屬性 說明
outputSchema.schemaRef.id 的ID target XDM結構 在先前的步驟中產生。
mappings.sourceType 要映射的源屬性類型。
mappings.source 需要對應至目標XDM路徑的來源屬性。
mappings.destination 要映射源屬性的目標XDM路徑。

回應

成功的回應會傳回新建立之對應的詳細資訊,包括其唯一識別碼(id)。 在以後的步驟中需要此值才能建立資料流。

{
    "id": "059c69f7207b4d7e9b48c47e2fd966a6",
    "version": 0,
    "createdDate": 1597784069368,
    "modifiedDate": 1597784069368,
    "createdBy": "{CREATED_BY}",
    "modifiedBy": "{MODIFIED_BY}"
}

建立流程

將資料從 SugarCRM Accounts & Contacts 到平台是建立資料流。 您現在已準備下列必要值:

資料流負責從源中調度和收集資料。 您可以在裝載中提供先前提及的值時,執行POST要求來建立資料流。

若要排程擷取,您必須先將開始時間值設為紀元時間(以秒為單位)。 然後,您必須將頻率值設定為 hourday. 間隔值指定兩個連續擷取之間的期間。 間隔值應設定為 124 取決於 scheduleParams.frequency 選擇其中一個 hourday.

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": "059c69f7207b4d7e9b48c47e2fd966a6",
                  "mappingVersion": "0"
              }
          }
      ],
      "scheduleParams": {
          "startTime": "1625040887",
          "frequency": "hour",
          "interval": 1
      }
  }'
屬性 說明
name 資料流的名稱。 請確保資料流的名稱具有描述性,因為您可以使用此名稱查找資料流的資訊。
description 一個可選值,可以包括該值以提供有關資料流的詳細資訊。
flowSpec.id 建立資料流所需的流規範ID。 此固定ID為: 6499120c-0b15-42dc-936e-847ea3c24d72.
flowSpec.version 流規範ID的相應版本。 此值預設為 1.0.
sourceConnectionIds 源連接ID 在先前的步驟中產生。
targetConnectionIds 目標連線ID 在先前的步驟中產生。
transformations 此屬性包含需要套用至資料的各種轉換。 將不符合XDM的資料帶入Platform時,此屬性為必要屬性。
transformations.name 指派給轉換的名稱。
transformations.params.mappingId 對應ID 在先前的步驟中產生。
transformations.params.mappingVersion 對應ID的對應版本。 此值預設為 0.
scheduleParams.startTime 此屬性包含有關資料流獲取調度的資訊。
scheduleParams.frequency 資料流收集資料的頻率。 可接受的值包括: hourday.
scheduleParams.interval 該間隔指定兩個連續流運行之間的週期。 間隔的值應為非零整數。 間隔值應設定為 124 取決於 scheduleParams.frequency 選擇其中一個 hourday.

回應

成功的回應會傳回ID(id)。 您可以使用此ID監視、更新或刪除資料流。

{
     "id": "fcd16140-81b4-422a-8f9a-eaa92796c4f4",
     "etag": "\"9200a171-0000-0200-0000-6368c1da0000\""
}

附錄

以下部分提供了可以監視、更新和刪除資料流的步驟資訊。

監視資料流

建立資料流後,您可以監視正在通過資料流進行內嵌的資料,以查看有關流運行、完成狀態和錯誤的資訊。 如需完整的API範例,請參閱 使用API監控來源資料流.

更新資料流

通過向發出PATCH請求,更新資料流的詳細資訊(如其名稱和說明),以及其運行計畫和關聯的映射集 /flows 端點 Flow Service API,同時提供資料流的ID。 發出PATCH請求時,必須提供資料流的唯一 etagIf-Match 頁首。 如需完整的API範例,請參閱 使用API更新源資料流

更新您的帳戶

通過向執行PATCH請求,更新源帳戶的名稱、說明和憑據 Flow Service API,同時將基本連線ID設為查詢參數。 提出PATCH請求時,您必須提供來源帳戶的唯一 etagIf-Match 頁首。 如需完整的API範例,請參閱 使用API更新您的來源帳戶.

刪除資料流

通過執行DELETE請求以刪除資料流 Flow Service API,同時提供您要在查詢參數中刪除之資料流的ID。 如需完整的API範例,請參閱 使用API刪除資料流.

刪除您的帳戶

對執行DELETE請求以刪除帳戶 Flow Service API,同時提供您要刪除之帳戶的基本連線ID。 如需完整的API範例,請參閱 使用API刪除您的來源帳戶.

本頁內容