私隱偏好

必要功能

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

一直啟用

Landing 診斷及遮蔽重播

量度公開網站到訪、流失及註冊連結操作,只使用此分頁的匿名識別碼,不連結帳戶。所有文字會遮蔽,表格會封鎖。

選擇性使用分析

是否允許 PostHog 分析網站使用情況?您可隨時在頁尾更新選擇。

另外允許重播此公開網站的操作

選擇性跨網站模式的重播會顯示公開頁面及操作,並遮蔽輸入及私人內容。App 重播須另行選擇。

須先開啟選擇性分析;此跨網站模式的重播預設關閉。上方 Landing 模式獨立運作。

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

搜尋資料會在使用時載入。亦可直接瀏覽下方分類。

廣告

分析廣告成效

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

POST /advertising-api/performance/analyze

Contract 核對日期: · sha256:9aedef8d43dd4514

概覽

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

HTTP 成功只表示本次操作的回應。背景工作須保留回傳 ID,並讀取同一操作,直至達到文件指定的終態。接受請求、排程成功或客戶端逾時,均不代表已發佈。

驗證及權限

接受的憑證類型
user_session, delegated_oauth, personal_access_token
委派權限
agent:advertising_read
最低工作空間角色
viewer
存取範圍
已登入用戶及獲授權資源範圍
需要所有工作空間同意
否
會改動狀態
否
完成依據
synchronous_http_response

憑證不能擴大持有人的權限。實際操作仍會檢查工作空間成員資格、資源擁有權、已選工作空間及能力授權。Tool profile 只會改變可見工具,不會授予權限。

請求欄位

必填表示在所屬物件及所選分支內必須提供;子欄位必填不代表可選的父物件亦變成必填。以下欄位名稱及規則直接來自 contract。

請求欄位
欄位/分支類型/必填限制
$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,並讀取同一操作,直至達到文件指定的終態。接受請求、排程成功或客戶端逾時,均不代表已發佈。

必填表示在所屬物件及所選分支內必須提供;子欄位必填不代表可選的父物件亦變成必填。以下欄位名稱及規則直接來自 contract。

回應及完成條件
欄位/分支類型/必填限制
$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;handler 錯誤可能採用 error/message/code envelope。請保留可用的 request_id 或 x-request-id,避免記錄憑證。遇到 401/403 時,須先修正存取問題;429 須遵守 Retry-After。寫入結果未明或回傳 5xx 時,請先讀取原有結果,再決定是否重試。只有操作支援時才可重用 idempotency key;並無通用重試或 exactly-once 保證。

問題排解指南

範例

以下虛構值已按 contract 驗證,並非真實帳戶 ID、憑證或發佈紀錄。請以已授權範圍回傳的 ID、已準備完成的素材及已審核排程取代,並在寫入前核對平台資格。此頁不會呼叫 API。

在伺服器環境設定 SOSOAPI_ACCESS_TOKEN,使用此操作接受的憑證。請勿將憑證放入瀏覽器程式。一般 AI Agent 建議透過 sosoapi auth login 使用瀏覽器 OAuth,由 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