विज्ञापन
विज्ञापन आँकड़ों की क्वेरी
स्पष्ट तारीखों, समय क्षेत्र, मुद्रा, एट्रिब्यूशन अवधि और कन्वर्ज़न कार्रवाई के साथ आधिकारिक सशुल्क विज्ञापन प्रदर्शन की सीमित जानकारी प्राप्त करें। अनुपलब्ध मेट्रिक अनुपलब्ध ही रहती हैं।
POST /advertising-api/insights/queryकॉन्ट्रैक्ट की समीक्षा: · sha256:9aedef8d43dd4514
परिचय
स्पष्ट तारीखों, समय क्षेत्र, मुद्रा, एट्रिब्यूशन अवधि और कन्वर्ज़न कार्रवाई के साथ आधिकारिक सशुल्क विज्ञापन प्रदर्शन की सीमित जानकारी प्राप्त करें। अनुपलब्ध मेट्रिक अनुपलब्ध ही रहती हैं।
सफल HTTP रिस्पॉन्स का अर्थ अनुरोध पूरा होने के बजाय स्वीकार होना हो सकता है। बैकग्राउंड काम में लौटाई ID सहेजें और समाप्ति तक वही ऑपरेशन जाँचें। निर्धारित या स्वीकृत पोस्ट प्लेटफ़ॉर्म की पुष्टि पर ही प्रकाशित है; क्लाइंट टाइमआउट परिणाम सिद्ध नहीं करता।
प्रमाणीकरण और अनुमतियाँ
टोकन केवल मालिक के अधिकार इस्तेमाल कर सकता है। हर अनुरोध वर्कस्पेस सदस्यता, संसाधन स्वामित्व, चुने वर्कस्पेस और दी क्षमताएँ जाँचता है। Core और full प्रोफ़ाइल दिखने वाले टूल बदलते हैं; एक्सेस नहीं देते।
अनुरोध के फ़ील्ड
Required का अर्थ पैरेंट ऑब्जेक्ट और चुनी शाखा के भीतर अनिवार्य है। अनिवार्य चाइल्ड से वैकल्पिक पैरेंट अनिवार्य नहीं होता। नीचे के नियम और फ़ील्ड नाम कॉन्ट्रैक्ट से लिए गए हैं।
| फ़ील्ड / शाखा | प्रकार / अनिवार्य | शर्तें |
|---|---|---|
$ | objectपैरेंट में अनिवार्य |
|
workspace_id | stringपैरेंट में अनिवार्य |
|
advertising_account_id | stringपैरेंट में अनिवार्य |
|
level | stringपैरेंट में अनिवार्य |
|
start_date | stringपैरेंट में अनिवार्य |
|
end_date | stringपैरेंट में अनिवार्य |
|
action_attribution_windows | arrayपैरेंट में अनिवार्य |
|
action_attribution_windows[] | stringवैकल्पिक / आइटम |
|
action_report_time | stringपैरेंट में अनिवार्य |
|
conversion_action_type | stringपैरेंट में अनिवार्य |
|
revenue_action_type | stringपैरेंट में अनिवार्य |
|
after | stringवैकल्पिक / आइटम |
|
limit | integerवैकल्पिक / आइटम |
|
संपूर्ण 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)$"
},
"advertising_account_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)$"
},
"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}$"
},
"after": {
"type": "string",
"maxLength": 2048
},
"limit": {
"default": 25,
"type": "integer",
"minimum": 1,
"maximum": 50
}
},
"required": [
"workspace_id",
"advertising_account_id",
"level",
"start_date",
"end_date",
"action_attribution_windows",
"action_report_time",
"conversion_action_type",
"revenue_action_type"
],
"additionalProperties": false
}रिस्पॉन्स और पूर्णता
सफल HTTP स्टेटस: 200. When the operation is complete: synchronous_http_response.
सफल HTTP रिस्पॉन्स का अर्थ अनुरोध पूरा होने के बजाय स्वीकार होना हो सकता है। बैकग्राउंड काम में लौटाई ID सहेजें और समाप्ति तक वही ऑपरेशन जाँचें। निर्धारित या स्वीकृत पोस्ट प्लेटफ़ॉर्म की पुष्टि पर ही प्रकाशित है; क्लाइंट टाइमआउट परिणाम सिद्ध नहीं करता।
Required का अर्थ पैरेंट ऑब्जेक्ट और चुनी शाखा के भीतर अनिवार्य है। अनिवार्य चाइल्ड से वैकल्पिक पैरेंट अनिवार्य नहीं होता। नीचे के नियम और फ़ील्ड नाम कॉन्ट्रैक्ट से लिए गए हैं।
| फ़ील्ड / शाखा | प्रकार / अनिवार्य | शर्तें |
|---|---|---|
$ | objectपैरेंट में अनिवार्य | — |
contract_version | stringपैरेंट में अनिवार्य |
|
source_id | stringपैरेंट में अनिवार्य |
|
source_sha256 | stringपैरेंट में अनिवार्य |
|
identity_verification | stringपैरेंट में अनिवार्य |
|
currency | stringपैरेंट में अनिवार्य |
|
timezone | stringपैरेंट में अनिवार्य |
|
selection | objectपैरेंट में अनिवार्य | — |
selection.provider_api_version | stringपैरेंट में अनिवार्य |
|
selection.provider_account_id | stringपैरेंट में अनिवार्य |
|
selection.currency | stringपैरेंट में अनिवार्य |
|
selection.timezone | stringपैरेंट में अनिवार्य |
|
selection.level | stringपैरेंट में अनिवार्य |
|
selection.start_date | stringपैरेंट में अनिवार्य |
|
selection.end_date | stringपैरेंट में अनिवार्य |
|
selection.action_attribution_windows | arrayपैरेंट में अनिवार्य |
|
selection.action_attribution_windows[] | stringवैकल्पिक / आइटम |
|
selection.action_report_time | stringपैरेंट में अनिवार्य |
|
selection.conversion_action_type | stringपैरेंट में अनिवार्य |
|
selection.revenue_action_type | stringपैरेंट में अनिवार्य |
|
complete | booleanपैरेंट में अनिवार्य | — |
rows | arrayपैरेंट में अनिवार्य |
|
rows[] | objectवैकल्पिक / आइटम | — |
rows[].row_id | stringपैरेंट में अनिवार्य |
|
rows[].metrics | objectपैरेंट में अनिवार्य | — |
rows[].metrics.spend | objectपैरेंट में अनिवार्य | — |
rows[].metrics.spend.value | string | nullपैरेंट में अनिवार्य | — |
rows[].metrics.spend.valueanyOf 1 | stringपैरेंट में अनिवार्य |
|
rows[].metrics.spend.valueanyOf 2 | nullपैरेंट में अनिवार्य | — |
rows[].metrics.spend.unit | stringपैरेंट में अनिवार्य |
|
rows[].metrics.spend.availability | stringपैरेंट में अनिवार्य |
|
rows[].metrics.spend.reason | string | nullपैरेंट में अनिवार्य | — |
rows[].metrics.spend.reasonanyOf 1 | stringपैरेंट में अनिवार्य |
|
rows[].metrics.spend.reasonanyOf 2 | nullपैरेंट में अनिवार्य | — |
rows[].metrics.spend.input_refs | arrayपैरेंट में अनिवार्य |
|
rows[].metrics.spend.input_refs[] | stringवैकल्पिक / आइटम |
|
rows[].metrics.clicks | objectपैरेंट में अनिवार्य | — |
rows[].metrics.clicks.value | string | nullपैरेंट में अनिवार्य | — |
rows[].metrics.clicks.valueanyOf 1 | stringपैरेंट में अनिवार्य |
|
rows[].metrics.clicks.valueanyOf 2 | nullपैरेंट में अनिवार्य | — |
rows[].metrics.clicks.unit | stringपैरेंट में अनिवार्य |
|
rows[].metrics.clicks.availability | stringपैरेंट में अनिवार्य |
|
rows[].metrics.clicks.reason | string | nullपैरेंट में अनिवार्य | — |
rows[].metrics.clicks.reasonanyOf 1 | stringपैरेंट में अनिवार्य |
|
rows[].metrics.clicks.reasonanyOf 2 | nullपैरेंट में अनिवार्य | — |
rows[].metrics.clicks.input_refs | arrayपैरेंट में अनिवार्य |
|
rows[].metrics.clicks.input_refs[] | stringवैकल्पिक / आइटम |
|
rows[].metrics.conversions | objectपैरेंट में अनिवार्य | — |
rows[].metrics.conversions.value | string | nullपैरेंट में अनिवार्य | — |
rows[].metrics.conversions.valueanyOf 1 | stringपैरेंट में अनिवार्य |
|
rows[].metrics.conversions.valueanyOf 2 | nullपैरेंट में अनिवार्य | — |
rows[].metrics.conversions.unit | stringपैरेंट में अनिवार्य |
|
rows[].metrics.conversions.availability | stringपैरेंट में अनिवार्य |
|
rows[].metrics.conversions.reason | string | nullपैरेंट में अनिवार्य | — |
rows[].metrics.conversions.reasonanyOf 1 | stringपैरेंट में अनिवार्य |
|
rows[].metrics.conversions.reasonanyOf 2 | nullपैरेंट में अनिवार्य | — |
rows[].metrics.conversions.input_refs | arrayपैरेंट में अनिवार्य |
|
rows[].metrics.conversions.input_refs[] | stringवैकल्पिक / आइटम |
|
rows[].metrics.attributed_revenue | objectपैरेंट में अनिवार्य | — |
rows[].metrics.attributed_revenue.value | string | nullपैरेंट में अनिवार्य | — |
rows[].metrics.attributed_revenue.valueanyOf 1 | stringपैरेंट में अनिवार्य |
|
rows[].metrics.attributed_revenue.valueanyOf 2 | nullपैरेंट में अनिवार्य | — |
rows[].metrics.attributed_revenue.unit | stringपैरेंट में अनिवार्य |
|
rows[].metrics.attributed_revenue.availability | stringपैरेंट में अनिवार्य |
|
rows[].metrics.attributed_revenue.reason | string | nullपैरेंट में अनिवार्य | — |
rows[].metrics.attributed_revenue.reasonanyOf 1 | stringपैरेंट में अनिवार्य |
|
rows[].metrics.attributed_revenue.reasonanyOf 2 | nullपैरेंट में अनिवार्य | — |
rows[].metrics.attributed_revenue.input_refs | arrayपैरेंट में अनिवार्य |
|
rows[].metrics.attributed_revenue.input_refs[] | stringवैकल्पिक / आइटम |
|
rows[].metrics.cpc | objectपैरेंट में अनिवार्य | — |
rows[].metrics.cpc.value | string | nullपैरेंट में अनिवार्य | — |
rows[].metrics.cpc.valueanyOf 1 | stringपैरेंट में अनिवार्य |
|
rows[].metrics.cpc.valueanyOf 2 | nullपैरेंट में अनिवार्य | — |
rows[].metrics.cpc.unit | stringपैरेंट में अनिवार्य |
|
rows[].metrics.cpc.availability | stringपैरेंट में अनिवार्य |
|
rows[].metrics.cpc.reason | string | nullपैरेंट में अनिवार्य | — |
rows[].metrics.cpc.reasonanyOf 1 | stringपैरेंट में अनिवार्य |
|
rows[].metrics.cpc.reasonanyOf 2 | nullपैरेंट में अनिवार्य | — |
rows[].metrics.cpc.input_refs | arrayपैरेंट में अनिवार्य |
|
rows[].metrics.cpc.input_refs[] | stringवैकल्पिक / आइटम |
|
rows[].metrics.cpa | objectपैरेंट में अनिवार्य | — |
rows[].metrics.cpa.value | string | nullपैरेंट में अनिवार्य | — |
rows[].metrics.cpa.valueanyOf 1 | stringपैरेंट में अनिवार्य |
|
rows[].metrics.cpa.valueanyOf 2 | nullपैरेंट में अनिवार्य | — |
rows[].metrics.cpa.unit | stringपैरेंट में अनिवार्य |
|
rows[].metrics.cpa.availability | stringपैरेंट में अनिवार्य |
|
rows[].metrics.cpa.reason | string | nullपैरेंट में अनिवार्य | — |
rows[].metrics.cpa.reasonanyOf 1 | stringपैरेंट में अनिवार्य |
|
rows[].metrics.cpa.reasonanyOf 2 | nullपैरेंट में अनिवार्य | — |
rows[].metrics.cpa.input_refs | arrayपैरेंट में अनिवार्य |
|
rows[].metrics.cpa.input_refs[] | stringवैकल्पिक / आइटम |
|
rows[].metrics.attributed_roas | objectपैरेंट में अनिवार्य | — |
rows[].metrics.attributed_roas.value | string | nullपैरेंट में अनिवार्य | — |
rows[].metrics.attributed_roas.valueanyOf 1 | stringपैरेंट में अनिवार्य |
|
rows[].metrics.attributed_roas.valueanyOf 2 | nullपैरेंट में अनिवार्य | — |
rows[].metrics.attributed_roas.unit | stringपैरेंट में अनिवार्य |
|
rows[].metrics.attributed_roas.availability | stringपैरेंट में अनिवार्य |
|
rows[].metrics.attributed_roas.reason | string | nullपैरेंट में अनिवार्य | — |
rows[].metrics.attributed_roas.reasonanyOf 1 | stringपैरेंट में अनिवार्य |
|
rows[].metrics.attributed_roas.reasonanyOf 2 | nullपैरेंट में अनिवार्य | — |
rows[].metrics.attributed_roas.input_refs | arrayपैरेंट में अनिवार्य |
|
rows[].metrics.attributed_roas.input_refs[] | stringवैकल्पिक / आइटम |
|
totals | objectपैरेंट में अनिवार्य | — |
totals.spend | objectपैरेंट में अनिवार्य | — |
totals.spend.value | string | nullपैरेंट में अनिवार्य | — |
totals.spend.valueanyOf 1 | stringपैरेंट में अनिवार्य |
|
totals.spend.valueanyOf 2 | nullपैरेंट में अनिवार्य | — |
totals.spend.unit | stringपैरेंट में अनिवार्य |
|
totals.spend.availability | stringपैरेंट में अनिवार्य |
|
totals.spend.reason | string | nullपैरेंट में अनिवार्य | — |
totals.spend.reasonanyOf 1 | stringपैरेंट में अनिवार्य |
|
totals.spend.reasonanyOf 2 | nullपैरेंट में अनिवार्य | — |
totals.spend.input_refs | arrayपैरेंट में अनिवार्य |
|
totals.spend.input_refs[] | stringवैकल्पिक / आइटम |
|
totals.clicks | objectपैरेंट में अनिवार्य | — |
totals.clicks.value | string | nullपैरेंट में अनिवार्य | — |
totals.clicks.valueanyOf 1 | stringपैरेंट में अनिवार्य |
|
totals.clicks.valueanyOf 2 | nullपैरेंट में अनिवार्य | — |
totals.clicks.unit | stringपैरेंट में अनिवार्य |
|
totals.clicks.availability | stringपैरेंट में अनिवार्य |
|
totals.clicks.reason | string | nullपैरेंट में अनिवार्य | — |
totals.clicks.reasonanyOf 1 | stringपैरेंट में अनिवार्य |
|
totals.clicks.reasonanyOf 2 | nullपैरेंट में अनिवार्य | — |
totals.clicks.input_refs | arrayपैरेंट में अनिवार्य |
|
totals.clicks.input_refs[] | stringवैकल्पिक / आइटम |
|
totals.conversions | objectपैरेंट में अनिवार्य | — |
totals.conversions.value | string | nullपैरेंट में अनिवार्य | — |
totals.conversions.valueanyOf 1 | stringपैरेंट में अनिवार्य |
|
totals.conversions.valueanyOf 2 | nullपैरेंट में अनिवार्य | — |
totals.conversions.unit | stringपैरेंट में अनिवार्य |
|
totals.conversions.availability | stringपैरेंट में अनिवार्य |
|
totals.conversions.reason | string | nullपैरेंट में अनिवार्य | — |
totals.conversions.reasonanyOf 1 | stringपैरेंट में अनिवार्य |
|
totals.conversions.reasonanyOf 2 | nullपैरेंट में अनिवार्य | — |
totals.conversions.input_refs | arrayपैरेंट में अनिवार्य |
|
totals.conversions.input_refs[] | stringवैकल्पिक / आइटम |
|
totals.attributed_revenue | objectपैरेंट में अनिवार्य | — |
totals.attributed_revenue.value | string | nullपैरेंट में अनिवार्य | — |
totals.attributed_revenue.valueanyOf 1 | stringपैरेंट में अनिवार्य |
|
totals.attributed_revenue.valueanyOf 2 | nullपैरेंट में अनिवार्य | — |
totals.attributed_revenue.unit | stringपैरेंट में अनिवार्य |
|
totals.attributed_revenue.availability | stringपैरेंट में अनिवार्य |
|
totals.attributed_revenue.reason | string | nullपैरेंट में अनिवार्य | — |
totals.attributed_revenue.reasonanyOf 1 | stringपैरेंट में अनिवार्य |
|
totals.attributed_revenue.reasonanyOf 2 | nullपैरेंट में अनिवार्य | — |
totals.attributed_revenue.input_refs | arrayपैरेंट में अनिवार्य |
|
totals.attributed_revenue.input_refs[] | stringवैकल्पिक / आइटम |
|
totals.cpc | objectपैरेंट में अनिवार्य | — |
totals.cpc.value | string | nullपैरेंट में अनिवार्य | — |
totals.cpc.valueanyOf 1 | stringपैरेंट में अनिवार्य |
|
totals.cpc.valueanyOf 2 | nullपैरेंट में अनिवार्य | — |
totals.cpc.unit | stringपैरेंट में अनिवार्य |
|
totals.cpc.availability | stringपैरेंट में अनिवार्य |
|
totals.cpc.reason | string | nullपैरेंट में अनिवार्य | — |
totals.cpc.reasonanyOf 1 | stringपैरेंट में अनिवार्य |
|
totals.cpc.reasonanyOf 2 | nullपैरेंट में अनिवार्य | — |
totals.cpc.input_refs | arrayपैरेंट में अनिवार्य |
|
totals.cpc.input_refs[] | stringवैकल्पिक / आइटम |
|
totals.cpa | objectपैरेंट में अनिवार्य | — |
totals.cpa.value | string | nullपैरेंट में अनिवार्य | — |
totals.cpa.valueanyOf 1 | stringपैरेंट में अनिवार्य |
|
totals.cpa.valueanyOf 2 | nullपैरेंट में अनिवार्य | — |
totals.cpa.unit | stringपैरेंट में अनिवार्य |
|
totals.cpa.availability | stringपैरेंट में अनिवार्य |
|
totals.cpa.reason | string | nullपैरेंट में अनिवार्य | — |
totals.cpa.reasonanyOf 1 | stringपैरेंट में अनिवार्य |
|
totals.cpa.reasonanyOf 2 | nullपैरेंट में अनिवार्य | — |
totals.cpa.input_refs | arrayपैरेंट में अनिवार्य |
|
totals.cpa.input_refs[] | stringवैकल्पिक / आइटम |
|
totals.attributed_roas | objectपैरेंट में अनिवार्य | — |
totals.attributed_roas.value | string | nullपैरेंट में अनिवार्य | — |
totals.attributed_roas.valueanyOf 1 | stringपैरेंट में अनिवार्य |
|
totals.attributed_roas.valueanyOf 2 | nullपैरेंट में अनिवार्य | — |
totals.attributed_roas.unit | stringपैरेंट में अनिवार्य |
|
totals.attributed_roas.availability | stringपैरेंट में अनिवार्य |
|
totals.attributed_roas.reason | string | nullपैरेंट में अनिवार्य | — |
totals.attributed_roas.reasonanyOf 1 | stringपैरेंट में अनिवार्य |
|
totals.attributed_roas.reasonanyOf 2 | nullपैरेंट में अनिवार्य | — |
totals.attributed_roas.input_refs | arrayपैरेंट में अनिवार्य |
|
totals.attributed_roas.input_refs[] | stringवैकल्पिक / आइटम |
|
gaps | arrayपैरेंट में अनिवार्य |
|
gaps[] | stringवैकल्पिक / आइटम |
|
suggestions | arrayपैरेंट में अनिवार्य |
|
suggestions[] | objectवैकल्पिक / आइटम | — |
suggestions[].rule_id | stringपैरेंट में अनिवार्य |
|
suggestions[].rule_version | numberपैरेंट में अनिवार्य |
|
suggestions[].proposal | stringपैरेंट में अनिवार्य |
|
suggestions[].input_refs | arrayपैरेंट में अनिवार्य |
|
suggestions[].input_refs[] | stringवैकल्पिक / आइटम |
|
suggestions[].limitations | stringपैरेंट में अनिवार्य |
|
advertising_account_id | stringपैरेंट में अनिवार्य |
|
next_cursor | string | nullपैरेंट में अनिवार्य | — |
next_cursoranyOf 1 | stringपैरेंट में अनिवार्य |
|
next_cursoranyOf 2 | nullपैरेंट में अनिवार्य | — |
संपूर्ण 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"
]
}
},
"advertising_account_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)$"
},
"next_cursor": {
"anyOf": [
{
"type": "string",
"maxLength": 2048
},
{
"type": "null"
}
]
}
},
"required": [
"contract_version",
"source_id",
"source_sha256",
"identity_verification",
"currency",
"timezone",
"selection",
"complete",
"rows",
"totals",
"gaps",
"suggestions",
"advertising_account_id",
"next_cursor"
]
}त्रुटियाँ और सुरक्षित पुनः प्रयास
HTTP स्टेटस और रिस्पॉन्स बॉडी जाँचें। 400 वैलिडेशन त्रुटि में ZodError हो सकता है; हैंडलर त्रुटियाँ error, message और code फ़ील्ड इस्तेमाल करती हैं। जाँच के लिए request_id या x-request-id रखें, क्रेडेंशियल के बिना। फिर प्रयास से पहले 401/403 एक्सेस त्रुटियाँ ठीक करें और 429 के लिए Retry-After का पालन करें। राइट अनिश्चित हो या 5xx लौटाए, तो पहले मौजूदा परिणाम पढ़ें। idempotency key केवल समर्थित स्थान पर दोबारा इस्तेमाल करें; पुनः प्रयास का व्यवहार ऑपरेशन के अनुसार बदलता है और ठीक एक बार डिलीवरी की गारंटी नहीं देता।
समस्या निवारण गाइडउदाहरण
उदाहरणों में स्कीमा से जाँचे काल्पनिक मान हैं। IDs को अधिकृत IDs, मीडिया को तैयार एसेट और तारीखों को पुष्ट प्रकाशन समय से बदलें। राइट सबमिट करने से पहले खाते की पात्रता जाँचें। यह पेज API अनुरोध नहीं भेजता।
सर्वर पर SOSOAPI_ACCESS_TOKEN को इस ऑपरेशन के स्वीकार्य क्रेडेंशियल से सेट करें और ब्राउज़र कोड से बाहर रखें। AI एजेंट के लिए sosoapi auth login से ब्राउज़र साइन-इन करें और CLI को क्रेडेंशियल रिफ़्रेश करने दें।
request.json
{
"workspace_id": "11111111-1111-4111-8111-111111111111",
"advertising_account_id": "11111111-1111-4111-8111-111111111111",
"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"
}cURL
curl --request POST \
"https://gqeshlawtcexsapabaui.supabase.co/functions/v1/advertising-api/insights/query" \
-H "Authorization: Bearer $SOSOAPI_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @request.jsonJavaScript
// 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/insights/query", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer " + token },
body: JSON.stringify({
"workspace_id": "11111111-1111-4111-8111-111111111111",
"advertising_account_id": "11111111-1111-4111-8111-111111111111",
"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"
})
});
const result = await response.json();
// Check response.ok, the operation-specific body and completion state before continuing.CLI
npx sosoapi api post /advertising-api/insights/query < 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": [],
"advertising_account_id": "11111111-1111-4111-8111-111111111111",
"next_cursor": null
}