隱私偏好

必要功能

用於安全驗證及網站基本功能。

一律啟用

Landing 診斷與遮蔽重播

使用僅限此分頁的匿名識別碼,衡量公開網站造訪、流失及註冊連結互動,不會連結帳號。所有文字均會遮蔽,表單也會封鎖。

選用的使用分析

允許 PostHog 使用分析嗎?可隨時在頁尾更改選擇。

同時允許在此公開網站進行工作階段重播

選用跨網站模式的重播會顯示公開頁面與互動,並遮蔽輸入內容及私人內容。應用程式重播需另外選擇。

需要允許選用分析;此跨網站模式的重播預設關閉。上方的 Landing 模式會獨立運作。

瀏覽器分析選擇不會啟用帳戶分析。

僅在使用時載入搜尋。在下方瀏覽所有類別。

廣告

分析廣告成效

使用明確歸因及確切來源雜湊,分析有數量上限的客戶提供付費報表。不會存取平台或聲稱獲利因果關係。

POST /advertising-api/performance/analyze

契約檢閱日期: · sha256:9aedef8d43dd4514

概覽

使用明確歸因及確切來源雜湊,分析有數量上限的客戶提供付費報表。不會存取平台或聲稱獲利因果關係。

成功 HTTP 回應可能表示請求已接受,並非已完成。背景工作請儲存回傳 ID,持續檢查同一操作直到完成。已排程或已接受的貼文,只有平台確認後才算已發布;用戶端逾時無法證明結果。

驗證與權限

接受的憑證類別
user_session, delegated_oauth, personal_access_token
委派能力
agent:advertising_read
最低工作空間角色
viewer
存取範圍
此使用者有權存取的資源
需要所有工作空間同意
否
變更狀態
否
操作完成時
synchronous_http_response

權杖只能使用其擁有者持有的權利。每次請求會檢查工作空間成員資格、資源擁有權、所選工作空間及已授予能力。core 與 full 設定檔只變更顯示的工具,不會授予存取權。

請求欄位

「必填」是指在其父物件及所選分支內必填。必填子欄位不會使選填父物件變成必填。下列規則與欄位名稱均複製自契約。

請求欄位
欄位 / 分支類型 / 必填約束
$object在父物件中必填
  • additionalProperties: false
workspace_idstring在父物件中必填
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
source_kindstring在父物件中必填
  • enum: ["customer_import","official_meta_api"]
source_idstring在父物件中必填
  • minLength: 1
  • maxLength: 100
provider_api_versionstring在父物件中必填
  • const: "v26.0"
provider_account_idstring在父物件中必填
  • pattern: "^[1-9]\\d{1,24}$"
currencystring在父物件中必填
  • pattern: "^[A-Z]{3}$"
timezonestring在父物件中必填
  • minLength: 1
  • maxLength: 100
levelstring在父物件中必填
  • enum: ["campaign","adset","ad"]
start_datestring在父物件中必填
  • pattern: "^\\d{4}-\\d{2}-\\d{2}$"
end_datestring在父物件中必填
  • pattern: "^\\d{4}-\\d{2}-\\d{2}$"
action_attribution_windowsarray在父物件中必填
  • minItems: 1
  • maxItems: 1
action_attribution_windows[]string選填/項目
  • enum: ["1d_click","7d_click","1d_view"]
action_report_timestring在父物件中必填
  • enum: ["impression","conversion"]
conversion_action_typestring在父物件中必填
  • pattern: "^[a-z][a-z0-9_.]{0,99}$"
revenue_action_typestring在父物件中必填
  • pattern: "^[a-z][a-z0-9_.]{0,99}$"
completeboolean在父物件中必填—
rowsarray在父物件中必填
  • maxItems: 500
rows[]object選填/項目
  • additionalProperties: false
rows[].account_idstring在父物件中必填
  • pattern: "^[1-9]\\d{1,24}$"
rows[].account_currencystring在父物件中必填
  • pattern: "^[A-Z]{3}$"
rows[].campaign_idstring在父物件中必填
  • pattern: "^[1-9]\\d{1,24}$"
rows[].campaign_namestring選填/項目
  • maxLength: 200
rows[].adset_idstring選填/項目
  • pattern: "^[1-9]\\d{1,24}$"
rows[].ad_idstring選填/項目
  • pattern: "^[1-9]\\d{1,24}$"
rows[].date_startstring在父物件中必填
  • pattern: "^\\d{4}-\\d{2}-\\d{2}$"
rows[].date_stopstring在父物件中必填
  • pattern: "^\\d{4}-\\d{2}-\\d{2}$"
rows[].spendstring選填/項目
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
rows[].clicksstring選填/項目
  • pattern: "^\\d{1,15}$"
rows[].actionsarray選填/項目
  • maxItems: 100
rows[].actions[]object選填/項目
  • additionalProperties: false
rows[].actions[].action_typestring在父物件中必填
  • pattern: "^[a-z][a-z0-9_.]{0,99}$"
rows[].actions[].valuestring選填/項目
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
rows[].actions[].1d_clickstring選填/項目
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
rows[].actions[].7d_clickstring選填/項目
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
rows[].actions[].1d_viewstring選填/項目
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
rows[].action_valuesarray選填/項目
  • maxItems: 100
rows[].action_values[]object選填/項目
  • additionalProperties: false
rows[].action_values[].action_typestring在父物件中必填
  • pattern: "^[a-z][a-z0-9_.]{0,99}$"
rows[].action_values[].valuestring選填/項目
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
rows[].action_values[].1d_clickstring選填/項目
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
rows[].action_values[].7d_clickstring選填/項目
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
rows[].action_values[].1d_viewstring選填/項目
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
完整 JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "source_kind": {
      "type": "string",
      "enum": [
        "customer_import",
        "official_meta_api"
      ]
    },
    "source_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "provider_api_version": {
      "type": "string",
      "const": "v26.0"
    },
    "provider_account_id": {
      "type": "string",
      "pattern": "^[1-9]\\d{1,24}$"
    },
    "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
    },
    "timezone": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "level": {
      "type": "string",
      "enum": [
        "campaign",
        "adset",
        "ad"
      ]
    },
    "start_date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "end_date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "action_attribution_windows": {
      "minItems": 1,
      "maxItems": 1,
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "1d_click",
          "7d_click",
          "1d_view"
        ]
      }
    },
    "action_report_time": {
      "type": "string",
      "enum": [
        "impression",
        "conversion"
      ]
    },
    "conversion_action_type": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_.]{0,99}$"
    },
    "revenue_action_type": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_.]{0,99}$"
    },
    "complete": {
      "type": "boolean"
    },
    "rows": {
      "maxItems": 500,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "pattern": "^[1-9]\\d{1,24}$"
          },
          "account_currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "campaign_id": {
            "type": "string",
            "pattern": "^[1-9]\\d{1,24}$"
          },
          "campaign_name": {
            "type": "string",
            "maxLength": 200
          },
          "adset_id": {
            "type": "string",
            "pattern": "^[1-9]\\d{1,24}$"
          },
          "ad_id": {
            "type": "string",
            "pattern": "^[1-9]\\d{1,24}$"
          },
          "date_start": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "date_stop": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "spend": {
            "type": "string",
            "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
          },
          "clicks": {
            "type": "string",
            "pattern": "^\\d{1,15}$"
          },
          "actions": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "action_type": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.]{0,99}$"
                },
                "value": {
                  "type": "string",
                  "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
                },
                "1d_click": {
                  "type": "string",
                  "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
                },
                "7d_click": {
                  "type": "string",
                  "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
                },
                "1d_view": {
                  "type": "string",
                  "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
                }
              },
              "required": [
                "action_type"
              ],
              "additionalProperties": false
            }
          },
          "action_values": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "action_type": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.]{0,99}$"
                },
                "value": {
                  "type": "string",
                  "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
                },
                "1d_click": {
                  "type": "string",
                  "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
                },
                "7d_click": {
                  "type": "string",
                  "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
                },
                "1d_view": {
                  "type": "string",
                  "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
                }
              },
              "required": [
                "action_type"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "account_id",
          "account_currency",
          "campaign_id",
          "date_start",
          "date_stop"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "workspace_id",
    "source_kind",
    "source_id",
    "provider_api_version",
    "provider_account_id",
    "currency",
    "timezone",
    "level",
    "start_date",
    "end_date",
    "action_attribution_windows",
    "action_report_time",
    "conversion_action_type",
    "revenue_action_type",
    "complete",
    "rows"
  ],
  "additionalProperties": false
}

回應與完成

成功 HTTP 狀態:200。操作完成時: synchronous_http_response.

成功 HTTP 回應可能表示請求已接受,並非已完成。背景工作請儲存回傳 ID,持續檢查同一操作直到完成。已排程或已接受的貼文,只有平台確認後才算已發布;用戶端逾時無法證明結果。

「必填」是指在其父物件及所選分支內必填。必填子欄位不會使選填父物件變成必填。下列規則與欄位名稱均複製自契約。

回應與完成
欄位 / 分支類型 / 必填約束
$object在父物件中必填—
contract_versionstring在父物件中必填
  • const: "ad-performance/v1"
source_idstring在父物件中必填
  • maxLength: 100
source_sha256string在父物件中必填
  • pattern: "^[a-f0-9]{64}$"
identity_verificationstring在父物件中必填
  • enum: ["customer_supplied","accepted_provider_grant"]
currencystring在父物件中必填
  • pattern: "^[A-Z]{3}$"
timezonestring在父物件中必填
  • maxLength: 100
selectionobject在父物件中必填—
selection.provider_api_versionstring在父物件中必填
  • const: "v26.0"
selection.provider_account_idstring在父物件中必填
  • pattern: "^[1-9]\\d{1,24}$"
selection.currencystring在父物件中必填
  • pattern: "^[A-Z]{3}$"
selection.timezonestring在父物件中必填
  • maxLength: 100
selection.levelstring在父物件中必填
  • enum: ["campaign","adset","ad"]
selection.start_datestring在父物件中必填
  • pattern: "^\\d{4}-\\d{2}-\\d{2}$"
selection.end_datestring在父物件中必填
  • pattern: "^\\d{4}-\\d{2}-\\d{2}$"
selection.action_attribution_windowsarray在父物件中必填
  • minItems: 1
  • maxItems: 1
selection.action_attribution_windows[]string選填/項目
  • enum: ["1d_click","7d_click","1d_view"]
selection.action_report_timestring在父物件中必填
  • enum: ["impression","conversion"]
selection.conversion_action_typestring在父物件中必填
  • maxLength: 100
selection.revenue_action_typestring在父物件中必填
  • maxLength: 100
completeboolean在父物件中必填—
rowsarray在父物件中必填
  • maxItems: 500
rows[]object選填/項目—
rows[].row_idstring在父物件中必填
  • maxLength: 100
rows[].metricsobject在父物件中必填—
rows[].metrics.spendobject在父物件中必填—
rows[].metrics.spend.valuestring | null在父物件中必填—
rows[].metrics.spend.valueanyOf 1string在父物件中必填
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
rows[].metrics.spend.valueanyOf 2null在父物件中必填—
rows[].metrics.spend.unitstring在父物件中必填
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
rows[].metrics.spend.availabilitystring在父物件中必填
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
rows[].metrics.spend.reasonstring | null在父物件中必填—
rows[].metrics.spend.reasonanyOf 1string在父物件中必填
  • maxLength: 300
rows[].metrics.spend.reasonanyOf 2null在父物件中必填—
rows[].metrics.spend.input_refsarray在父物件中必填
  • maxItems: 2000
rows[].metrics.spend.input_refs[]string選填/項目
  • maxLength: 300
rows[].metrics.clicksobject在父物件中必填—
rows[].metrics.clicks.valuestring | null在父物件中必填—
rows[].metrics.clicks.valueanyOf 1string在父物件中必填
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
rows[].metrics.clicks.valueanyOf 2null在父物件中必填—
rows[].metrics.clicks.unitstring在父物件中必填
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
rows[].metrics.clicks.availabilitystring在父物件中必填
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
rows[].metrics.clicks.reasonstring | null在父物件中必填—
rows[].metrics.clicks.reasonanyOf 1string在父物件中必填
  • maxLength: 300
rows[].metrics.clicks.reasonanyOf 2null在父物件中必填—
rows[].metrics.clicks.input_refsarray在父物件中必填
  • maxItems: 2000
rows[].metrics.clicks.input_refs[]string選填/項目
  • maxLength: 300
rows[].metrics.conversionsobject在父物件中必填—
rows[].metrics.conversions.valuestring | null在父物件中必填—
rows[].metrics.conversions.valueanyOf 1string在父物件中必填
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
rows[].metrics.conversions.valueanyOf 2null在父物件中必填—
rows[].metrics.conversions.unitstring在父物件中必填
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
rows[].metrics.conversions.availabilitystring在父物件中必填
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
rows[].metrics.conversions.reasonstring | null在父物件中必填—
rows[].metrics.conversions.reasonanyOf 1string在父物件中必填
  • maxLength: 300
rows[].metrics.conversions.reasonanyOf 2null在父物件中必填—
rows[].metrics.conversions.input_refsarray在父物件中必填
  • maxItems: 2000
rows[].metrics.conversions.input_refs[]string選填/項目
  • maxLength: 300
rows[].metrics.attributed_revenueobject在父物件中必填—
rows[].metrics.attributed_revenue.valuestring | null在父物件中必填—
rows[].metrics.attributed_revenue.valueanyOf 1string在父物件中必填
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
rows[].metrics.attributed_revenue.valueanyOf 2null在父物件中必填—
rows[].metrics.attributed_revenue.unitstring在父物件中必填
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
rows[].metrics.attributed_revenue.availabilitystring在父物件中必填
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
rows[].metrics.attributed_revenue.reasonstring | null在父物件中必填—
rows[].metrics.attributed_revenue.reasonanyOf 1string在父物件中必填
  • maxLength: 300
rows[].metrics.attributed_revenue.reasonanyOf 2null在父物件中必填—
rows[].metrics.attributed_revenue.input_refsarray在父物件中必填
  • maxItems: 2000
rows[].metrics.attributed_revenue.input_refs[]string選填/項目
  • maxLength: 300
rows[].metrics.cpcobject在父物件中必填—
rows[].metrics.cpc.valuestring | null在父物件中必填—
rows[].metrics.cpc.valueanyOf 1string在父物件中必填
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
rows[].metrics.cpc.valueanyOf 2null在父物件中必填—
rows[].metrics.cpc.unitstring在父物件中必填
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
rows[].metrics.cpc.availabilitystring在父物件中必填
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
rows[].metrics.cpc.reasonstring | null在父物件中必填—
rows[].metrics.cpc.reasonanyOf 1string在父物件中必填
  • maxLength: 300
rows[].metrics.cpc.reasonanyOf 2null在父物件中必填—
rows[].metrics.cpc.input_refsarray在父物件中必填
  • maxItems: 2000
rows[].metrics.cpc.input_refs[]string選填/項目
  • maxLength: 300
rows[].metrics.cpaobject在父物件中必填—
rows[].metrics.cpa.valuestring | null在父物件中必填—
rows[].metrics.cpa.valueanyOf 1string在父物件中必填
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
rows[].metrics.cpa.valueanyOf 2null在父物件中必填—
rows[].metrics.cpa.unitstring在父物件中必填
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
rows[].metrics.cpa.availabilitystring在父物件中必填
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
rows[].metrics.cpa.reasonstring | null在父物件中必填—
rows[].metrics.cpa.reasonanyOf 1string在父物件中必填
  • maxLength: 300
rows[].metrics.cpa.reasonanyOf 2null在父物件中必填—
rows[].metrics.cpa.input_refsarray在父物件中必填
  • maxItems: 2000
rows[].metrics.cpa.input_refs[]string選填/項目
  • maxLength: 300
rows[].metrics.attributed_roasobject在父物件中必填—
rows[].metrics.attributed_roas.valuestring | null在父物件中必填—
rows[].metrics.attributed_roas.valueanyOf 1string在父物件中必填
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
rows[].metrics.attributed_roas.valueanyOf 2null在父物件中必填—
rows[].metrics.attributed_roas.unitstring在父物件中必填
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
rows[].metrics.attributed_roas.availabilitystring在父物件中必填
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
rows[].metrics.attributed_roas.reasonstring | null在父物件中必填—
rows[].metrics.attributed_roas.reasonanyOf 1string在父物件中必填
  • maxLength: 300
rows[].metrics.attributed_roas.reasonanyOf 2null在父物件中必填—
rows[].metrics.attributed_roas.input_refsarray在父物件中必填
  • maxItems: 2000
rows[].metrics.attributed_roas.input_refs[]string選填/項目
  • maxLength: 300
totalsobject在父物件中必填—
totals.spendobject在父物件中必填—
totals.spend.valuestring | null在父物件中必填—
totals.spend.valueanyOf 1string在父物件中必填
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
totals.spend.valueanyOf 2null在父物件中必填—
totals.spend.unitstring在父物件中必填
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
totals.spend.availabilitystring在父物件中必填
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
totals.spend.reasonstring | null在父物件中必填—
totals.spend.reasonanyOf 1string在父物件中必填
  • maxLength: 300
totals.spend.reasonanyOf 2null在父物件中必填—
totals.spend.input_refsarray在父物件中必填
  • maxItems: 2000
totals.spend.input_refs[]string選填/項目
  • maxLength: 300
totals.clicksobject在父物件中必填—
totals.clicks.valuestring | null在父物件中必填—
totals.clicks.valueanyOf 1string在父物件中必填
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
totals.clicks.valueanyOf 2null在父物件中必填—
totals.clicks.unitstring在父物件中必填
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
totals.clicks.availabilitystring在父物件中必填
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
totals.clicks.reasonstring | null在父物件中必填—
totals.clicks.reasonanyOf 1string在父物件中必填
  • maxLength: 300
totals.clicks.reasonanyOf 2null在父物件中必填—
totals.clicks.input_refsarray在父物件中必填
  • maxItems: 2000
totals.clicks.input_refs[]string選填/項目
  • maxLength: 300
totals.conversionsobject在父物件中必填—
totals.conversions.valuestring | null在父物件中必填—
totals.conversions.valueanyOf 1string在父物件中必填
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
totals.conversions.valueanyOf 2null在父物件中必填—
totals.conversions.unitstring在父物件中必填
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
totals.conversions.availabilitystring在父物件中必填
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
totals.conversions.reasonstring | null在父物件中必填—
totals.conversions.reasonanyOf 1string在父物件中必填
  • maxLength: 300
totals.conversions.reasonanyOf 2null在父物件中必填—
totals.conversions.input_refsarray在父物件中必填
  • maxItems: 2000
totals.conversions.input_refs[]string選填/項目
  • maxLength: 300
totals.attributed_revenueobject在父物件中必填—
totals.attributed_revenue.valuestring | null在父物件中必填—
totals.attributed_revenue.valueanyOf 1string在父物件中必填
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
totals.attributed_revenue.valueanyOf 2null在父物件中必填—
totals.attributed_revenue.unitstring在父物件中必填
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
totals.attributed_revenue.availabilitystring在父物件中必填
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
totals.attributed_revenue.reasonstring | null在父物件中必填—
totals.attributed_revenue.reasonanyOf 1string在父物件中必填
  • maxLength: 300
totals.attributed_revenue.reasonanyOf 2null在父物件中必填—
totals.attributed_revenue.input_refsarray在父物件中必填
  • maxItems: 2000
totals.attributed_revenue.input_refs[]string選填/項目
  • maxLength: 300
totals.cpcobject在父物件中必填—
totals.cpc.valuestring | null在父物件中必填—
totals.cpc.valueanyOf 1string在父物件中必填
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
totals.cpc.valueanyOf 2null在父物件中必填—
totals.cpc.unitstring在父物件中必填
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
totals.cpc.availabilitystring在父物件中必填
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
totals.cpc.reasonstring | null在父物件中必填—
totals.cpc.reasonanyOf 1string在父物件中必填
  • maxLength: 300
totals.cpc.reasonanyOf 2null在父物件中必填—
totals.cpc.input_refsarray在父物件中必填
  • maxItems: 2000
totals.cpc.input_refs[]string選填/項目
  • maxLength: 300
totals.cpaobject在父物件中必填—
totals.cpa.valuestring | null在父物件中必填—
totals.cpa.valueanyOf 1string在父物件中必填
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
totals.cpa.valueanyOf 2null在父物件中必填—
totals.cpa.unitstring在父物件中必填
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
totals.cpa.availabilitystring在父物件中必填
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
totals.cpa.reasonstring | null在父物件中必填—
totals.cpa.reasonanyOf 1string在父物件中必填
  • maxLength: 300
totals.cpa.reasonanyOf 2null在父物件中必填—
totals.cpa.input_refsarray在父物件中必填
  • maxItems: 2000
totals.cpa.input_refs[]string選填/項目
  • maxLength: 300
totals.attributed_roasobject在父物件中必填—
totals.attributed_roas.valuestring | null在父物件中必填—
totals.attributed_roas.valueanyOf 1string在父物件中必填
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
totals.attributed_roas.valueanyOf 2null在父物件中必填—
totals.attributed_roas.unitstring在父物件中必填
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
totals.attributed_roas.availabilitystring在父物件中必填
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
totals.attributed_roas.reasonstring | null在父物件中必填—
totals.attributed_roas.reasonanyOf 1string在父物件中必填
  • maxLength: 300
totals.attributed_roas.reasonanyOf 2null在父物件中必填—
totals.attributed_roas.input_refsarray在父物件中必填
  • maxItems: 2000
totals.attributed_roas.input_refs[]string選填/項目
  • maxLength: 300
gapsarray在父物件中必填
  • maxItems: 1000
gaps[]string選填/項目
  • maxLength: 300
suggestionsarray在父物件中必填
  • maxItems: 3
suggestions[]object選填/項目—
suggestions[].rule_idstring在父物件中必填
  • enum: ["supply_revenue","review_comparable_creative_test","complete_coverage"]
suggestions[].rule_versionnumber在父物件中必填
  • const: 1
suggestions[].proposalstring在父物件中必填
  • maxLength: 600
suggestions[].input_refsarray在父物件中必填
  • maxItems: 2000
suggestions[].input_refs[]string選填/項目
  • maxLength: 300
suggestions[].limitationsstring在父物件中必填
  • const: "Observational comparison only; no causal uplift or profitability claim. Human review required."
完整 JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "contract_version": {
      "type": "string",
      "const": "ad-performance/v1"
    },
    "source_id": {
      "type": "string",
      "maxLength": 100
    },
    "source_sha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "identity_verification": {
      "type": "string",
      "enum": [
        "customer_supplied",
        "accepted_provider_grant"
      ]
    },
    "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
    },
    "timezone": {
      "type": "string",
      "maxLength": 100
    },
    "selection": {
      "type": "object",
      "properties": {
        "provider_api_version": {
          "type": "string",
          "const": "v26.0"
        },
        "provider_account_id": {
          "type": "string",
          "pattern": "^[1-9]\\d{1,24}$"
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Z]{3}$"
        },
        "timezone": {
          "type": "string",
          "maxLength": 100
        },
        "level": {
          "type": "string",
          "enum": [
            "campaign",
            "adset",
            "ad"
          ]
        },
        "start_date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "end_date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "action_attribution_windows": {
          "minItems": 1,
          "maxItems": 1,
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "1d_click",
              "7d_click",
              "1d_view"
            ]
          }
        },
        "action_report_time": {
          "type": "string",
          "enum": [
            "impression",
            "conversion"
          ]
        },
        "conversion_action_type": {
          "type": "string",
          "maxLength": 100
        },
        "revenue_action_type": {
          "type": "string",
          "maxLength": 100
        }
      },
      "required": [
        "provider_api_version",
        "provider_account_id",
        "currency",
        "timezone",
        "level",
        "start_date",
        "end_date",
        "action_attribution_windows",
        "action_report_time",
        "conversion_action_type",
        "revenue_action_type"
      ]
    },
    "complete": {
      "type": "boolean"
    },
    "rows": {
      "maxItems": 500,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "row_id": {
            "type": "string",
            "maxLength": 100
          },
          "metrics": {
            "type": "object",
            "properties": {
              "spend": {
                "type": "object",
                "properties": {
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "currency",
                      "count",
                      "currency_per_click",
                      "currency_per_conversion",
                      "ratio"
                    ]
                  },
                  "availability": {
                    "type": "string",
                    "enum": [
                      "available",
                      "missing_input",
                      "zero_denominator",
                      "incompatible",
                      "partial"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "input_refs": {
                    "maxItems": 2000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    }
                  }
                },
                "required": [
                  "value",
                  "unit",
                  "availability",
                  "reason",
                  "input_refs"
                ]
              },
              "clicks": {
                "type": "object",
                "properties": {
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "currency",
                      "count",
                      "currency_per_click",
                      "currency_per_conversion",
                      "ratio"
                    ]
                  },
                  "availability": {
                    "type": "string",
                    "enum": [
                      "available",
                      "missing_input",
                      "zero_denominator",
                      "incompatible",
                      "partial"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "input_refs": {
                    "maxItems": 2000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    }
                  }
                },
                "required": [
                  "value",
                  "unit",
                  "availability",
                  "reason",
                  "input_refs"
                ]
              },
              "conversions": {
                "type": "object",
                "properties": {
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "currency",
                      "count",
                      "currency_per_click",
                      "currency_per_conversion",
                      "ratio"
                    ]
                  },
                  "availability": {
                    "type": "string",
                    "enum": [
                      "available",
                      "missing_input",
                      "zero_denominator",
                      "incompatible",
                      "partial"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "input_refs": {
                    "maxItems": 2000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    }
                  }
                },
                "required": [
                  "value",
                  "unit",
                  "availability",
                  "reason",
                  "input_refs"
                ]
              },
              "attributed_revenue": {
                "type": "object",
                "properties": {
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "currency",
                      "count",
                      "currency_per_click",
                      "currency_per_conversion",
                      "ratio"
                    ]
                  },
                  "availability": {
                    "type": "string",
                    "enum": [
                      "available",
                      "missing_input",
                      "zero_denominator",
                      "incompatible",
                      "partial"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "input_refs": {
                    "maxItems": 2000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    }
                  }
                },
                "required": [
                  "value",
                  "unit",
                  "availability",
                  "reason",
                  "input_refs"
                ]
              },
              "cpc": {
                "type": "object",
                "properties": {
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "currency",
                      "count",
                      "currency_per_click",
                      "currency_per_conversion",
                      "ratio"
                    ]
                  },
                  "availability": {
                    "type": "string",
                    "enum": [
                      "available",
                      "missing_input",
                      "zero_denominator",
                      "incompatible",
                      "partial"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "input_refs": {
                    "maxItems": 2000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    }
                  }
                },
                "required": [
                  "value",
                  "unit",
                  "availability",
                  "reason",
                  "input_refs"
                ]
              },
              "cpa": {
                "type": "object",
                "properties": {
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "currency",
                      "count",
                      "currency_per_click",
                      "currency_per_conversion",
                      "ratio"
                    ]
                  },
                  "availability": {
                    "type": "string",
                    "enum": [
                      "available",
                      "missing_input",
                      "zero_denominator",
                      "incompatible",
                      "partial"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "input_refs": {
                    "maxItems": 2000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    }
                  }
                },
                "required": [
                  "value",
                  "unit",
                  "availability",
                  "reason",
                  "input_refs"
                ]
              },
              "attributed_roas": {
                "type": "object",
                "properties": {
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "currency",
                      "count",
                      "currency_per_click",
                      "currency_per_conversion",
                      "ratio"
                    ]
                  },
                  "availability": {
                    "type": "string",
                    "enum": [
                      "available",
                      "missing_input",
                      "zero_denominator",
                      "incompatible",
                      "partial"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "input_refs": {
                    "maxItems": 2000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    }
                  }
                },
                "required": [
                  "value",
                  "unit",
                  "availability",
                  "reason",
                  "input_refs"
                ]
              }
            },
            "required": [
              "spend",
              "clicks",
              "conversions",
              "attributed_revenue",
              "cpc",
              "cpa",
              "attributed_roas"
            ]
          }
        },
        "required": [
          "row_id",
          "metrics"
        ]
      }
    },
    "totals": {
      "type": "object",
      "properties": {
        "spend": {
          "type": "object",
          "properties": {
            "value": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "unit": {
              "type": "string",
              "enum": [
                "currency",
                "count",
                "currency_per_click",
                "currency_per_conversion",
                "ratio"
              ]
            },
            "availability": {
              "type": "string",
              "enum": [
                "available",
                "missing_input",
                "zero_denominator",
                "incompatible",
                "partial"
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 300
                },
                {
                  "type": "null"
                }
              ]
            },
            "input_refs": {
              "maxItems": 2000,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            }
          },
          "required": [
            "value",
            "unit",
            "availability",
            "reason",
            "input_refs"
          ]
        },
        "clicks": {
          "type": "object",
          "properties": {
            "value": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "unit": {
              "type": "string",
              "enum": [
                "currency",
                "count",
                "currency_per_click",
                "currency_per_conversion",
                "ratio"
              ]
            },
            "availability": {
              "type": "string",
              "enum": [
                "available",
                "missing_input",
                "zero_denominator",
                "incompatible",
                "partial"
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 300
                },
                {
                  "type": "null"
                }
              ]
            },
            "input_refs": {
              "maxItems": 2000,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            }
          },
          "required": [
            "value",
            "unit",
            "availability",
            "reason",
            "input_refs"
          ]
        },
        "conversions": {
          "type": "object",
          "properties": {
            "value": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "unit": {
              "type": "string",
              "enum": [
                "currency",
                "count",
                "currency_per_click",
                "currency_per_conversion",
                "ratio"
              ]
            },
            "availability": {
              "type": "string",
              "enum": [
                "available",
                "missing_input",
                "zero_denominator",
                "incompatible",
                "partial"
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 300
                },
                {
                  "type": "null"
                }
              ]
            },
            "input_refs": {
              "maxItems": 2000,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            }
          },
          "required": [
            "value",
            "unit",
            "availability",
            "reason",
            "input_refs"
          ]
        },
        "attributed_revenue": {
          "type": "object",
          "properties": {
            "value": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "unit": {
              "type": "string",
              "enum": [
                "currency",
                "count",
                "currency_per_click",
                "currency_per_conversion",
                "ratio"
              ]
            },
            "availability": {
              "type": "string",
              "enum": [
                "available",
                "missing_input",
                "zero_denominator",
                "incompatible",
                "partial"
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 300
                },
                {
                  "type": "null"
                }
              ]
            },
            "input_refs": {
              "maxItems": 2000,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            }
          },
          "required": [
            "value",
            "unit",
            "availability",
            "reason",
            "input_refs"
          ]
        },
        "cpc": {
          "type": "object",
          "properties": {
            "value": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "unit": {
              "type": "string",
              "enum": [
                "currency",
                "count",
                "currency_per_click",
                "currency_per_conversion",
                "ratio"
              ]
            },
            "availability": {
              "type": "string",
              "enum": [
                "available",
                "missing_input",
                "zero_denominator",
                "incompatible",
                "partial"
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 300
                },
                {
                  "type": "null"
                }
              ]
            },
            "input_refs": {
              "maxItems": 2000,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            }
          },
          "required": [
            "value",
            "unit",
            "availability",
            "reason",
            "input_refs"
          ]
        },
        "cpa": {
          "type": "object",
          "properties": {
            "value": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "unit": {
              "type": "string",
              "enum": [
                "currency",
                "count",
                "currency_per_click",
                "currency_per_conversion",
                "ratio"
              ]
            },
            "availability": {
              "type": "string",
              "enum": [
                "available",
                "missing_input",
                "zero_denominator",
                "incompatible",
                "partial"
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 300
                },
                {
                  "type": "null"
                }
              ]
            },
            "input_refs": {
              "maxItems": 2000,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            }
          },
          "required": [
            "value",
            "unit",
            "availability",
            "reason",
            "input_refs"
          ]
        },
        "attributed_roas": {
          "type": "object",
          "properties": {
            "value": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "unit": {
              "type": "string",
              "enum": [
                "currency",
                "count",
                "currency_per_click",
                "currency_per_conversion",
                "ratio"
              ]
            },
            "availability": {
              "type": "string",
              "enum": [
                "available",
                "missing_input",
                "zero_denominator",
                "incompatible",
                "partial"
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 300
                },
                {
                  "type": "null"
                }
              ]
            },
            "input_refs": {
              "maxItems": 2000,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            }
          },
          "required": [
            "value",
            "unit",
            "availability",
            "reason",
            "input_refs"
          ]
        }
      },
      "required": [
        "spend",
        "clicks",
        "conversions",
        "attributed_revenue",
        "cpc",
        "cpa",
        "attributed_roas"
      ]
    },
    "gaps": {
      "maxItems": 1000,
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 300
      }
    },
    "suggestions": {
      "maxItems": 3,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "rule_id": {
            "type": "string",
            "enum": [
              "supply_revenue",
              "review_comparable_creative_test",
              "complete_coverage"
            ]
          },
          "rule_version": {
            "type": "number",
            "const": 1
          },
          "proposal": {
            "type": "string",
            "maxLength": 600
          },
          "input_refs": {
            "maxItems": 2000,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 300
            }
          },
          "limitations": {
            "type": "string",
            "const": "Observational comparison only; no causal uplift or profitability claim. Human review required."
          }
        },
        "required": [
          "rule_id",
          "rule_version",
          "proposal",
          "input_refs",
          "limitations"
        ]
      }
    }
  },
  "required": [
    "contract_version",
    "source_id",
    "source_sha256",
    "identity_verification",
    "currency",
    "timezone",
    "selection",
    "complete",
    "rows",
    "totals",
    "gaps",
    "suggestions"
  ]
}

錯誤與安全重試

檢查 HTTP 狀態和回應內容。400 驗證錯誤可能包含 ZodError;處理常式錯誤使用 error、message 和 code 欄位。保留 request_id 或 x-request-id 以便診斷,但不要保留憑證。先解決 401/403 存取錯誤再重試,並在收到 429 時遵循 Retry-After。如寫入結果不確定或回傳 5xx,先讀取現有結果。僅在支援時重複使用冪等鍵;重試行為因操作而異,並不保證恰好傳送一次。

故障排查指南

範例

這些範例使用已依結構描述檢查的虛構值。請將 ID 替換為您有權使用的 ID、將媒體替換為已就緒素材,並將日期替換為已確認的發布時間。提交寫入前,請檢查帳號資格。本頁不會傳送 API 請求。

在伺服器上將 SOSOAPI_ACCESS_TOKEN 設為此操作接受的憑證,且不要放入瀏覽器程式碼。AI 代理程式請使用 sosoapi auth login 透過瀏覽器登入,並由 CLI 更新憑證。

request.json

{
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "source_kind": "customer_import",
  "source_id": "example",
  "provider_api_version": "v26.0",
  "provider_account_id": "12345",
  "currency": "USD",
  "timezone": "UTC",
  "level": "campaign",
  "start_date": "2099-01-15",
  "end_date": "2099-01-15",
  "action_attribution_windows": [
    "1d_click"
  ],
  "action_report_time": "impression",
  "conversion_action_type": "example",
  "revenue_action_type": "example",
  "complete": false,
  "rows": []
}

cURL

curl --request POST \
  "https://gqeshlawtcexsapabaui.supabase.co/functions/v1/advertising-api/performance/analyze" \
  -H "Authorization: Bearer $SOSOAPI_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @request.json

JavaScript

// Server-side JavaScript. Do not print tokens or credential-bearing responses.
const token = process.env.SOSOAPI_ACCESS_TOKEN;
if (!token) throw new Error("Set an accepted credential for this operation");
const response = await fetch("https://gqeshlawtcexsapabaui.supabase.co/functions/v1/advertising-api/performance/analyze", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer " + token },
  body: JSON.stringify({
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "source_kind": "customer_import",
  "source_id": "example",
  "provider_api_version": "v26.0",
  "provider_account_id": "12345",
  "currency": "USD",
  "timezone": "UTC",
  "level": "campaign",
  "start_date": "2099-01-15",
  "end_date": "2099-01-15",
  "action_attribution_windows": [
    "1d_click"
  ],
  "action_report_time": "impression",
  "conversion_action_type": "example",
  "revenue_action_type": "example",
  "complete": false,
  "rows": []
})
});
const result = await response.json();
// Check response.ok, the operation-specific body and completion state before continuing.

CLI

npx sosoapi api post /advertising-api/performance/analyze < request.json

合成回應範例

{
  "contract_version": "ad-performance/v1",
  "source_id": "example",
  "source_sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "identity_verification": "customer_supplied",
  "currency": "USD",
  "timezone": "UTC",
  "selection": {
    "provider_api_version": "v26.0",
    "provider_account_id": "12345",
    "currency": "USD",
    "timezone": "UTC",
    "level": "campaign",
    "start_date": "2099-01-15",
    "end_date": "2099-01-15",
    "action_attribution_windows": [
      "1d_click"
    ],
    "action_report_time": "impression",
    "conversion_action_type": "example",
    "revenue_action_type": "example"
  },
  "complete": false,
  "rows": [],
  "totals": {
    "spend": {
      "value": null,
      "unit": "currency",
      "availability": "available",
      "reason": null,
      "input_refs": []
    },
    "clicks": {
      "value": null,
      "unit": "currency",
      "availability": "available",
      "reason": null,
      "input_refs": []
    },
    "conversions": {
      "value": null,
      "unit": "currency",
      "availability": "available",
      "reason": null,
      "input_refs": []
    },
    "attributed_revenue": {
      "value": null,
      "unit": "currency",
      "availability": "available",
      "reason": null,
      "input_refs": []
    },
    "cpc": {
      "value": null,
      "unit": "currency",
      "availability": "available",
      "reason": null,
      "input_refs": []
    },
    "cpa": {
      "value": null,
      "unit": "currency",
      "availability": "available",
      "reason": null,
      "input_refs": []
    },
    "attributed_roas": {
      "value": null,
      "unit": "currency",
      "availability": "available",
      "reason": null,
      "input_refs": []
    }
  },
  "gaps": [],
  "suggestions": []
}

MCP: sosoapi_ads_performance_analyze