探索資料表,使用 Flow Service API

本教學課程提供的步驟說明如何使用 Flow Service API。

NOTE
為了探索您的資料表,您必須擁有表格來源的有效基本連線ID。 如果您沒有此ID,請參閱下列教學課程,以瞭解如何為表格來源建立基本連線ID的步驟:

快速入門

本指南需要您實際瞭解下列Adobe Experience Platform元件:

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

使用平台API

如需如何成功呼叫Platform API的詳細資訊,請參閱以下指南中的 Platform API快速入門.

探索您的資料表格

您可以透過向以下網站發出GET請求,擷取有關資料表格結構的資訊: Flow Service API,同時提供來源的基本連線ID。

API格式

GET /connections/{BASE_CONNECTION_ID}/explore?objectType=root
參數
說明
{BASE_CONNECTION_ID}
來源的基本連線ID。

要求

curl -X GET \
  'https://platform.adobe.io/data/foundation/flowservice/connections/5e73e5a2-dc36-45a8-9f16-93c7a43af318/explore?objectType=root' \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {IMS_ORG}' \
  -H 'x-sandbox-name: {SANDBOX_NAME}'

回應

成功的回應會從您的來源傳回資料表陣列。 找到您要帶入Platform的表格並記下該表格 path 屬性,因為您必須在下一個步驟中提供它以檢查其結構。

[
    {
        "type": "table",
        "name": "ACME Spring Campaign",
        "path": "acmeSpringCampaign",
        "canPreview": true,
        "canFetchSchema": true
    },
    {
        "type": "table",
        "name": "ACME Summer Campaign",
        "path": "acmeSummerCampaign",
        "canPreview": true,
        "canFetchSchema": true
    }
]

Inspect表格的結構

GET若要檢查資料表的內容,請對 Flow Service 將表格的路徑指定為查詢引數時的API。

API格式

GET /connections/{BASE_CONNECTION_ID}/explore?objectType=table&object={TABLE_PATH}
參數
說明
{BASE_CONNECTION_ID}
來源的基本連線ID。
{TABLE_PATH}
您要檢查的資料表的path屬性。

要求

curl -X GET \
  'https://platform.adobe.io/data/foundation/flowservice/connections/5e73e5a2-dc36-45a8-9f16-93c7a43af318/explore?objectType=table&object=acmeSpringCampaign' \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {IMS_ORG}' \
  -H 'x-sandbox-name: {SANDBOX_NAME}'

回應

成功的回應會傳回指定表格內容和結構的相關資訊。 有關每個表格欄的詳細資訊位於 columns 陣列。

{
  "format": "flat",
  "schema": {
    "columns": [
      {
        "name": "TestID",
        "type": "string",
        "xdm": {
          "type": "string"
        }
      },
      {
        "name": "Name",
        "type": "string",
        "xdm": {
          "type": "string"
        }
      },
      {
        "name": "Datefield",
        "type": "string",
        "meta:xdmType": "date-time",
        "xdm": {
          "type": "string",
          "format": "date-time"
        }
      },
      {
        "name": "complaint_type",
        "type": "string",
        "xdm": {
          "type": "string"
        }
      },
      {
        "name": "complaint_description",
        "type": "string",
        "xdm": {
          "type": "string"
        }
      },
      {
        "name": "status",
        "type": "string",
        "xdm": {
          "type": "string"
        }
      },
      {
        "name": "status_change_date",
        "type": "string",
        "meta:xdmType": "date-time",
        "xdm": {
          "type": "string",
          "format": "date-time"
        }
      },
      {
        "name": "city",
        "type": "string",
        "xdm": {
          "type": "string"
        }
      },
      {
        "name": "Datefield2",
        "type": "string",
        "meta:xdmType": "date-time",
        "xdm": {
          "type": "string",
          "format": "date-time"
        }
      }
    ]
  }
}

後續步驟

依照本教學課程,您已收集有關資料表結構和內容的資訊。 此外,您已擷取要擷取至Platform的表格路徑。 您可以使用此資訊來建立來源連線和資料流,以將您的資料匯入Platform。 如需有關如何使用建立來源連線和資料流的特定步驟,請參閱下列教學課程 Flow Service API:

recommendation-more-help
337b99bb-92fb-42ae-b6b7-c7042161d089