分析与洞察
预览已映射的报告模板字段
预览已映射的报告模板字段。使用明确指定并已审阅的数据集和版本;不会自动刷新数据源。 可将渲染输入通过管道传递给 sosoapi report render --output FILE。
POST /analytics-api/reporting/templates/preview契约审核日期: · sha256:d6e85a113e8fb367
概览
预览已映射的报告模板字段。使用明确指定并已审阅的数据集和版本;不会自动刷新数据源。 可将渲染输入通过管道传递给 sosoapi report render --output FILE。
成功 HTTP 响应可能表示请求已接受,并非已完成。背景工作请存储返回 ID,持续检查同一操作直到完成。已排程或已接受的帖子,只有平台确认后才算已发布;客户端逾时无法证明结果。
验证与权限
令牌只能使用其所有者持有的权利。每次请求会检查工作区成员资格、资源拥有权、所选工作区及已授予能力。core 与 full 配置只变更显示的工具,不会授予访问权限。
请求字段
「必填」是指在其父对象及所选分支内必填。必填子字段不会使可选父对象变成必填。下列规则与字段名称均复制自契约。
| 字段 / 分支 | 类型 / 必填 | 约束 |
|---|---|---|
$ | object在父对象中必填 |
|
workspace_id | string在父对象中必填 |
|
id | string在父对象中必填 |
|
version | integer在父对象中必填 |
|
dataset | object在父对象中必填 |
|
dataset.contractVersion | string在父对象中必填 |
|
dataset.id | string在父对象中必填 |
|
dataset.reviewedAt | string在父对象中必填 |
|
dataset.selection | object在父对象中必填 |
|
dataset.selection.workspaceId | string在父对象中必填 |
|
dataset.selection.accountIds | array在父对象中必填 |
|
dataset.selection.accountIds[] | string可选/项目 |
|
dataset.selection.platforms | array在父对象中必填 |
|
dataset.selection.platforms[] | string可选/项目 |
|
dataset.selection.startDate | string在父对象中必填 |
|
dataset.selection.endDate | string在父对象中必填 |
|
dataset.selection.timezone | string在父对象中必填 |
|
dataset.accounts | array在父对象中必填 |
|
dataset.accounts[] | object可选/项目 |
|
dataset.accounts[].id | string在父对象中必填 |
|
dataset.accounts[].workspaceId | string在父对象中必填 |
|
dataset.accounts[].platform | string在父对象中必填 |
|
dataset.accounts[].name | string在父对象中必填 |
|
dataset.accounts[].connectionStatus | string可选/项目 |
|
dataset.accounts[].healthMessage | string可选/项目 |
|
dataset.posts | array在父对象中必填 |
|
dataset.posts[] | object可选/项目 |
|
dataset.posts[].social_post_id | string在父对象中必填 |
|
dataset.posts[].workspace_id | string在父对象中必填 |
|
dataset.posts[].social_account_id | string在父对象中必填 |
|
dataset.posts[].platform | string在父对象中必填 |
|
dataset.posts[].provider_post_id | string在父对象中必填 |
|
dataset.posts[].provider_published_at | string | null在父对象中必填 | — |
dataset.posts[].provider_published_atanyOf 1 | string在父对象中必填 |
|
dataset.posts[].provider_published_atanyOf 2 | null在父对象中必填 | — |
dataset.posts[].content_format | string | null在父对象中必填 | — |
dataset.posts[].content_formatanyOf 1 | string在父对象中必填 |
|
dataset.posts[].content_formatanyOf 2 | null在父对象中必填 | — |
dataset.posts[].permalink | string | null在父对象中必填 | — |
dataset.posts[].permalinkanyOf 1 | string在父对象中必填 |
|
dataset.posts[].permalinkanyOf 2 | null在父对象中必填 | — |
dataset.posts[].provider_state | string在父对象中必填 |
|
dataset.posts[].first_seen_at | string在父对象中必填 |
|
dataset.posts[].last_seen_at | string在父对象中必填 |
|
dataset.posts[].scheduled_post_id | string | null在父对象中必填 | — |
dataset.posts[].scheduled_post_idanyOf 1 | string在父对象中必填 |
|
dataset.posts[].scheduled_post_idanyOf 2 | null在父对象中必填 | — |
dataset.posts[].provenance | object在父对象中必填 |
|
dataset.posts[].provenance.provider | string在父对象中必填 |
|
dataset.posts[].provenance.source | string在父对象中必填 |
|
dataset.posts[].provenance.source_job_id | string | null在父对象中必填 | — |
dataset.posts[].provenance.source_job_idanyOf 1 | string在父对象中必填 |
|
dataset.posts[].provenance.source_job_idanyOf 2 | null在父对象中必填 | — |
dataset.posts[].provenance.provider_api_version | string | null在父对象中必填 | — |
dataset.posts[].provenance.provider_api_versionanyOf 1 | string在父对象中必填 |
|
dataset.posts[].provenance.provider_api_versionanyOf 2 | null在父对象中必填 | — |
dataset.posts[].provenance.schema_version | string | null在父对象中必填 | — |
dataset.posts[].provenance.schema_versionanyOf 1 | string在父对象中必填 |
|
dataset.posts[].provenance.schema_versionanyOf 2 | null在父对象中必填 | — |
dataset.sources | array在父对象中必填 |
|
dataset.sources[] | object可选/项目 |
|
dataset.sources[].accountId | string在父对象中必填 |
|
dataset.sources[].platform | string在父对象中必填 |
|
dataset.sources[].resourceKind | string在父对象中必填 |
|
dataset.sources[].providerResourceId | string | null在父对象中必填 | — |
dataset.sources[].providerResourceIdanyOf 1 | string在父对象中必填 |
|
dataset.sources[].providerResourceIdanyOf 2 | null在父对象中必填 | — |
dataset.sources[].requestId | string | null在父对象中必填 | — |
dataset.sources[].requestIdanyOf 1 | string在父对象中必填 |
|
dataset.sources[].requestIdanyOf 2 | null在父对象中必填 | — |
dataset.sources[].status | string在父对象中必填 |
|
dataset.sources[].reason | string | null在父对象中必填 | — |
dataset.sources[].reasonanyOf 1 | string在父对象中必填 |
|
dataset.sources[].reasonanyOf 2 | null在父对象中必填 | — |
dataset.sources[].envelope | object | null在父对象中必填 | — |
dataset.sources[].envelopeanyOf 1 | object在父对象中必填 |
|
dataset.sources[].envelope.contract_versionanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.request_idanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.platformanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.resourceanyOf 1 | object在父对象中必填 |
|
dataset.sources[].envelope.resource.kindanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.resource.social_account_idanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.resource.provider_resource_idanyOf 1 | string | null在父对象中必填 | — |
dataset.sources[].envelope.provider_api_versionanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.fetched_atanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.statusanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.availabilityanyOf 1 | array在父对象中必填 |
|
dataset.sources[].envelope.availability[]anyOf 1 | object可选/项目 |
|
dataset.sources[].envelope.availability[].scopeanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.availability[].statusanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.availability[].reasonanyOf 1 | string可选/项目 |
|
dataset.sources[].envelope.availability[].diagnosticsanyOf 1 | object可选/项目 |
|
dataset.sources[].envelope.availability[].diagnostics.http_statusanyOf 1 | integer在父对象中必填 |
|
dataset.sources[].envelope.availability[].diagnostics.failed_stepanyOf 1 | string可选/项目 |
|
dataset.sources[].envelope.availability[].diagnostics.provider_codeanyOf 1 | number | string可选/项目 | — |
dataset.sources[].envelope.availability[].diagnostics.provider_codeanyOf 1 / anyOf 1 | number可选/项目 | — |
dataset.sources[].envelope.availability[].diagnostics.provider_codeanyOf 1 / anyOf 2 | string可选/项目 |
|
dataset.sources[].envelope.availability[].diagnostics.provider_subcodeanyOf 1 | number | string可选/项目 | — |
dataset.sources[].envelope.availability[].diagnostics.provider_subcodeanyOf 1 / anyOf 1 | number可选/项目 | — |
dataset.sources[].envelope.availability[].diagnostics.provider_subcodeanyOf 1 / anyOf 2 | string可选/项目 |
|
dataset.sources[].envelope.availability[].diagnostics.provider_typeanyOf 1 | string可选/项目 |
|
dataset.sources[].envelope.availability[].diagnostics.is_transientanyOf 1 | boolean可选/项目 | — |
dataset.sources[].envelope.availability[].diagnostics.provider_request_idanyOf 1 | string可选/项目 |
|
dataset.sources[].envelope.availability[].diagnostics.accessanyOf 1 | object可选/项目 |
|
dataset.sources[].envelope.availability[].diagnostics.access.login_modeanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.availability[].diagnostics.access.provider_hostanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.availability[].diagnostics.access.required_permissionsanyOf 1 | array在父对象中必填 |
|
dataset.sources[].envelope.availability[].diagnostics.access.required_permissions[]anyOf 1 | string可选/项目 |
|
dataset.sources[].envelope.availability[].diagnostics.access.current_connection_policy_permissionsanyOf 1 | array在父对象中必填 |
|
dataset.sources[].envelope.availability[].diagnostics.access.current_connection_policy_permissions[]anyOf 1 | string可选/项目 |
|
dataset.sources[].envelope.availability[].diagnostics.access.granted_permissionsanyOf 1 | array | null在父对象中必填 | — |
dataset.sources[].envelope.availability[].diagnostics.access.granted_permissionsanyOf 1 / anyOf 1 | array在父对象中必填 |
|
dataset.sources[].envelope.availability[].diagnostics.access.granted_permissions[]anyOf 1 / anyOf 1 | string可选/项目 |
|
dataset.sources[].envelope.availability[].diagnostics.access.granted_permissionsanyOf 1 / anyOf 2 | null在父对象中必填 | — |
dataset.sources[].envelope.availability[].diagnostics.access.grant_evidenceanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.availability[].diagnostics.access.permission_stateanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.availability[].diagnostics.access.grant_observed_atanyOf 1 | string可选/项目 |
|
dataset.sources[].envelope.availability[].diagnostics.access.app_accessanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.availability[].diagnostics.access.next_stepanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.provider_dataanyOf 1 | any JSON value | null在父对象中必填 | — |
dataset.sources[].envelope.provider_dataanyOf 1 / anyOf 1 | any JSON value在父对象中必填 | — |
dataset.sources[].envelope.provider_dataanyOf 1 / anyOf 2 | null在父对象中必填 | — |
dataset.sources[].envelope.requested_date_rangeanyOf 1 | object | null在父对象中必填 | — |
dataset.sources[].envelope.requested_date_rangeanyOf 1 / anyOf 1 | object在父对象中必填 |
|
dataset.sources[].envelope.requested_date_range.start_dateanyOf 1 / anyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.requested_date_range.end_dateanyOf 1 / anyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.requested_date_rangeanyOf 1 / anyOf 2 | null在父对象中必填 | — |
dataset.sources[].envelope.cacheanyOf 1 | object在父对象中必填 |
|
dataset.sources[].envelope.cache.authoritativeanyOf 1 | boolean在父对象中必填 |
|
dataset.sources[].envelope.cache.statusanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelope.cache.expires_atanyOf 1 | string在父对象中必填 |
|
dataset.sources[].envelopeanyOf 2 | null在父对象中必填 | — |
dataset.sources[].metrics | array在父对象中必填 |
|
dataset.sources[].metrics[] | object可选/项目 |
|
dataset.sources[].metrics[].key | string在父对象中必填 |
|
dataset.sources[].metrics[].definition | string在父对象中必填 |
|
dataset.sources[].metrics[].unit | string在父对象中必填 |
|
dataset.sources[].metrics[].grain | string在父对象中必填 |
|
dataset.sources[].metrics[].value | number | null在父对象中必填 | — |
dataset.sources[].metrics[].availability | string在父对象中必填 |
|
dataset.sources[].metrics[].reason | string | null在父对象中必填 | — |
dataset.sources[].metrics[].reasonanyOf 1 | string在父对象中必填 |
|
dataset.sources[].metrics[].reasonanyOf 2 | null在父对象中必填 | — |
dataset.sources[].metrics[].measurement | object在父对象中必填 |
|
dataset.sources[].metrics[].measurement.kind | string在父对象中必填 |
|
dataset.sources[].metrics[].measurement.period | string | null在父对象中必填 | — |
dataset.sources[].metrics[].measurement.periodanyOf 1 | string在父对象中必填 |
|
dataset.sources[].metrics[].measurement.periodanyOf 2 | null在父对象中必填 | — |
dataset.sources[].metrics[].measurement.start | string | null在父对象中必填 | — |
dataset.sources[].metrics[].measurement.startanyOf 1 | string在父对象中必填 |
|
dataset.sources[].metrics[].measurement.startanyOf 2 | null在父对象中必填 | — |
dataset.sources[].metrics[].measurement.end | string | null在父对象中必填 | — |
dataset.sources[].metrics[].measurement.endanyOf 1 | string在父对象中必填 |
|
dataset.sources[].metrics[].measurement.endanyOf 2 | null在父对象中必填 | — |
dataset.sources[].metrics[].measurement.timezone | string | null在父对象中必填 | — |
dataset.sources[].metrics[].measurement.timezoneanyOf 1 | string在父对象中必填 |
|
dataset.sources[].metrics[].measurement.timezoneanyOf 2 | null在父对象中必填 | — |
dataset.sources[].metrics[].sourcePath | string在父对象中必填 |
|
dataset.coverage | object在父对象中必填 |
|
dataset.coverage.population | string在父对象中必填 |
|
dataset.coverage.postsComplete | boolean在父对象中必填 | — |
dataset.coverage.nextCursor | string | null在父对象中必填 | — |
dataset.coverage.nextCursoranyOf 1 | string在父对象中必填 |
|
dataset.coverage.nextCursoranyOf 2 | null在父对象中必填 | — |
dataset.coverage.postLimit | integer在父对象中必填 |
|
dataset.coverage.postInsightsLimit | integer在父对象中必填 |
|
dataset.coverage.omittedPostInsights | integer在父对象中必填 |
|
dataset.coverage.notes | array在父对象中必填 |
|
dataset.coverage.notes[] | string可选/项目 |
|
dataset.customMetrics | array在父对象中必填 |
|
dataset.customMetrics[] | object可选/项目 |
|
dataset.customMetrics[].id | string在父对象中必填 |
|
dataset.customMetrics[].name | string在父对象中必填 |
|
dataset.customMetrics[].version | integer在父对象中必填 |
|
dataset.customMetrics[].expression | string在父对象中必填 |
|
dataset.customMetrics[].definition | string在父对象中必填 |
|
dataset.customMetrics[].unit | string在父对象中必填 |
|
dataset.customMetrics[].grain | string在父对象中必填 |
|
dataset.customMetrics[].rounding | object在父对象中必填 |
|
dataset.customMetrics[].rounding.decimalPlaces | integer在父对象中必填 |
|
dataset.customMetrics[].rounding.mode | string在父对象中必填 |
|
dataset.customMetrics[].inputs | array在父对象中必填 |
|
dataset.customMetrics[].inputs[] | object可选/项目 |
|
dataset.customMetrics[].inputs[].requestId | string | null在父对象中必填 | — |
dataset.customMetrics[].inputs[].requestIdanyOf 1 | string在父对象中必填 |
|
dataset.customMetrics[].inputs[].requestIdanyOf 2 | null在父对象中必填 | — |
dataset.customMetrics[].inputs[].sourcePath | string在父对象中必填 |
|
dataset.customMetrics[].inputs[].value | number | null在父对象中必填 | — |
dataset.customMetrics[].inputs[].availability | string在父对象中必填 |
|
dataset.customMetrics[].value | number | null在父对象中必填 | — |
dataset.customMetrics[].availability | string在父对象中必填 |
|
dataset.customMetrics[].reason | string | null在父对象中必填 | — |
dataset.customMetrics[].reasonanyOf 1 | string在父对象中必填 |
|
dataset.customMetrics[].reasonanyOf 2 | null在父对象中必填 | — |
dataset.customMetrics[].formula | object可选/项目 |
|
dataset.customMetrics[].formula.contractVersion | string在父对象中必填 |
|
dataset.customMetrics[].formula.id | string在父对象中必填 |
|
dataset.customMetrics[].formula.workspaceId | string在父对象中必填 |
|
dataset.customMetrics[].formula.name | string在父对象中必填 |
|
dataset.customMetrics[].formula.version | integer在父对象中必填 |
|
dataset.customMetrics[].formula.expression | string在父对象中必填 |
|
dataset.customMetrics[].formula.fields | array在父对象中必填 |
|
dataset.customMetrics[].formula.fields[] | object可选/项目 |
|
dataset.customMetrics[].formula.fields[].identifier | string在父对象中必填 |
|
dataset.customMetrics[].formula.fields[].selector | object在父对象中必填 |
|
dataset.customMetrics[].formula.fields[].selector.platform | string在父对象中必填 |
|
dataset.customMetrics[].formula.fields[].selector.key | string在父对象中必填 |
|
dataset.customMetrics[].formula.fields[].selector.definition | string在父对象中必填 |
|
dataset.customMetrics[].formula.fields[].selector.unit | string在父对象中必填 |
|
dataset.customMetrics[].formula.fields[].selector.grain | string在父对象中必填 |
|
dataset.customMetrics[].formula.fields[].selector.measurementKind | string在父对象中必填 |
|
dataset.customMetrics[].formula.fields[].selector.nativePeriod | string | null在父对象中必填 | — |
dataset.customMetrics[].formula.fields[].selector.nativePeriodanyOf 1 | string在父对象中必填 |
|
dataset.customMetrics[].formula.fields[].selector.nativePeriodanyOf 2 | null在父对象中必填 | — |
dataset.customMetrics[].formula.fields[].selector.timezone | string | null在父对象中必填 | — |
dataset.customMetrics[].formula.fields[].selector.timezoneanyOf 1 | string在父对象中必填 |
|
dataset.customMetrics[].formula.fields[].selector.timezoneanyOf 2 | null在父对象中必填 | — |
dataset.customMetrics[].formula.fields[].aggregation | string在父对象中必填 |
|
dataset.customMetrics[].formula.rounding | object在父对象中必填 |
|
dataset.customMetrics[].formula.rounding.decimalPlaces | integer在父对象中必填 |
|
dataset.customMetrics[].formula.rounding.mode | string在父对象中必填 |
|
dataset.customMetrics[].calculation | object可选/项目 |
|
dataset.customMetrics[].calculation.contractVersion | string在父对象中必填 |
|
dataset.customMetrics[].calculation.workspaceId | string在父对象中必填 |
|
dataset.customMetrics[].calculation.datasetId | string在父对象中必填 |
|
dataset.customMetrics[].calculation.formulaId | string在父对象中必填 |
|
dataset.customMetrics[].calculation.name | string在父对象中必填 |
|
dataset.customMetrics[].calculation.version | integer在父对象中必填 |
|
dataset.customMetrics[].calculation.expression | string在父对象中必填 |
|
dataset.customMetrics[].calculation.rounding | object在父对象中必填 |
|
dataset.customMetrics[].calculation.rounding.decimalPlaces | integer在父对象中必填 |
|
dataset.customMetrics[].calculation.rounding.mode | string在父对象中必填 |
|
dataset.customMetrics[].calculation.value | number | null在父对象中必填 | — |
dataset.customMetrics[].calculation.unit | string在父对象中必填 |
|
dataset.customMetrics[].calculation.status | string在父对象中必填 |
|
dataset.customMetrics[].calculation.code | string在父对象中必填 |
|
dataset.customMetrics[].calculation.reason | string | null在父对象中必填 | — |
dataset.customMetrics[].calculation.reasonanyOf 1 | string在父对象中必填 |
|
dataset.customMetrics[].calculation.reasonanyOf 2 | null在父对象中必填 | — |
dataset.customMetrics[].calculation.excludedInputIds | array在父对象中必填 |
|
dataset.customMetrics[].calculation.excludedInputIds[] | string可选/项目 |
|
dataset.customMetrics[].calculation.inputs | array在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[] | object可选/项目 |
|
dataset.customMetrics[].calculation.inputs[].inputId | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].selector | object在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].selector.platform | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].selector.key | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].selector.definition | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].selector.unit | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].selector.grain | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].selector.measurementKind | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].selector.nativePeriod | string | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].selector.nativePeriodanyOf 1 | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].selector.nativePeriodanyOf 2 | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].selector.timezone | string | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].selector.timezoneanyOf 1 | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].selector.timezoneanyOf 2 | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].value | number | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].availability | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].reason | string | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].reasonanyOf 1 | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].reasonanyOf 2 | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].measurement | object在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].measurement.kind | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].measurement.period | string | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].measurement.periodanyOf 1 | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].measurement.periodanyOf 2 | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].measurement.start | string | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].measurement.startanyOf 1 | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].measurement.startanyOf 2 | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].measurement.end | string | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].measurement.endanyOf 1 | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].measurement.endanyOf 2 | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].measurement.timezone | string | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].measurement.timezoneanyOf 1 | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].measurement.timezoneanyOf 2 | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].requestId | string | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].requestIdanyOf 1 | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].requestIdanyOf 2 | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].sourcePath | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].accountId | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].providerResourceId | string | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].providerResourceIdanyOf 1 | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].providerResourceIdanyOf 2 | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].fetchedAt | string | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].fetchedAtanyOf 1 | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].fetchedAtanyOf 2 | null在父对象中必填 | — |
dataset.customMetrics[].calculation.inputs[].identifier | string在父对象中必填 |
|
dataset.customMetrics[].calculation.inputs[].included | boolean在父对象中必填 | — |
完整 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)$"
},
"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)$"
},
"version": {
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
"dataset": {
"type": "object",
"properties": {
"contractVersion": {
"type": "string",
"const": "analytics-report/v1"
},
"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)$"
},
"reviewedAt": {
"type": "string",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"format": "date-time"
},
"selection": {
"type": "object",
"properties": {
"workspaceId": {
"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)$"
},
"accountIds": {
"minItems": 1,
"maxItems": 50,
"type": "array",
"items": {
"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)$"
}
},
"platforms": {
"minItems": 1,
"maxItems": 4,
"type": "array",
"items": {
"type": "string",
"enum": [
"facebook",
"instagram",
"threads",
"youtube"
]
}
},
"startDate": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"endDate": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"timezone": {
"type": "string",
"minLength": 1,
"maxLength": 100
}
},
"required": [
"workspaceId",
"accountIds",
"platforms",
"startDate",
"endDate",
"timezone"
],
"additionalProperties": false
},
"accounts": {
"maxItems": 50,
"type": "array",
"items": {
"type": "object",
"properties": {
"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)$"
},
"workspaceId": {
"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)$"
},
"platform": {
"type": "string",
"enum": [
"facebook",
"instagram",
"threads",
"youtube"
]
},
"name": {
"type": "string",
"maxLength": 500
},
"connectionStatus": {
"type": "string",
"maxLength": 100
},
"healthMessage": {
"type": "string",
"maxLength": 1000
}
},
"required": [
"id",
"workspaceId",
"platform",
"name"
],
"additionalProperties": false
}
},
"posts": {
"maxItems": 1000,
"type": "array",
"items": {
"type": "object",
"properties": {
"social_post_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)$"
},
"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)$"
},
"social_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)$"
},
"platform": {
"type": "string",
"enum": [
"instagram",
"facebook",
"threads",
"youtube"
]
},
"provider_post_id": {
"type": "string",
"minLength": 1,
"maxLength": 512
},
"provider_published_at": {
"anyOf": [
{
"type": "string",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"format": "date-time"
},
{
"type": "null"
}
]
},
"content_format": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 100
},
{
"type": "null"
}
]
},
"permalink": {
"anyOf": [
{
"type": "string",
"maxLength": 2048,
"format": "uri"
},
{
"type": "null"
}
]
},
"provider_state": {
"type": "string",
"enum": [
"available",
"deleted",
"unavailable",
"unknown"
]
},
"first_seen_at": {
"type": "string",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"format": "date-time"
},
"last_seen_at": {
"type": "string",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"format": "date-time"
},
"scheduled_post_id": {
"anyOf": [
{
"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)$"
},
{
"type": "null"
}
]
},
"provenance": {
"type": "object",
"properties": {
"provider": {
"type": "string",
"enum": [
"instagram",
"facebook",
"threads",
"youtube"
]
},
"source": {
"type": "string",
"enum": [
"provider_api",
"provider_webhook",
"publication_outcome",
"backfill"
]
},
"source_job_id": {
"anyOf": [
{
"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)$"
},
{
"type": "null"
}
]
},
"provider_api_version": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 200
},
{
"type": "null"
}
]
},
"schema_version": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 200
},
{
"type": "null"
}
]
}
},
"required": [
"provider",
"source",
"source_job_id",
"provider_api_version",
"schema_version"
],
"additionalProperties": false
}
},
"required": [
"social_post_id",
"workspace_id",
"social_account_id",
"platform",
"provider_post_id",
"provider_published_at",
"content_format",
"permalink",
"provider_state",
"first_seen_at",
"last_seen_at",
"scheduled_post_id",
"provenance"
],
"additionalProperties": false
}
},
"sources": {
"maxItems": 30,
"type": "array",
"items": {
"type": "object",
"properties": {
"accountId": {
"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)$"
},
"platform": {
"type": "string",
"enum": [
"facebook",
"instagram",
"threads",
"youtube"
]
},
"resourceKind": {
"type": "string",
"enum": [
"account",
"post"
]
},
"providerResourceId": {
"anyOf": [
{
"type": "string",
"maxLength": 512
},
{
"type": "null"
}
]
},
"requestId": {
"anyOf": [
{
"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)$"
},
{
"type": "null"
}
]
},
"status": {
"type": "string",
"enum": [
"available",
"partial",
"not_returned",
"unsupported",
"permission_required",
"threshold_not_met",
"no_data",
"failed",
"pending",
"stale"
]
},
"reason": {
"anyOf": [
{
"type": "string",
"maxLength": 8000
},
{
"type": "null"
}
]
},
"envelope": {
"anyOf": [
{
"type": "object",
"properties": {
"contract_version": {
"type": "string",
"const": "provider-insights/v1"
},
"request_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)$"
},
"platform": {
"type": "string",
"enum": [
"facebook",
"instagram",
"threads",
"youtube"
]
},
"resource": {
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"account",
"post"
]
},
"social_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)$"
},
"provider_resource_id": {
"type": [
"string",
"null"
]
}
},
"required": [
"kind",
"social_account_id",
"provider_resource_id"
],
"additionalProperties": false
},
"provider_api_version": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"fetched_at": {
"type": "string",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"format": "date-time"
},
"status": {
"type": "string",
"enum": [
"available",
"partial",
"unavailable"
]
},
"availability": {
"minItems": 1,
"maxItems": 64,
"type": "array",
"items": {
"type": "object",
"properties": {
"scope": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"status": {
"type": "string",
"enum": [
"available",
"partial",
"not_returned",
"unsupported",
"permission_required",
"threshold_not_met",
"no_data",
"failed"
]
},
"reason": {
"type": "string",
"minLength": 1,
"maxLength": 2000
},
"diagnostics": {
"type": "object",
"properties": {
"http_status": {
"type": "integer",
"minimum": 0,
"maximum": 599
},
"failed_step": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"provider_code": {
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"maxLength": 100
}
]
},
"provider_subcode": {
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"maxLength": 100
}
]
},
"provider_type": {
"type": "string",
"maxLength": 200
},
"is_transient": {
"type": "boolean"
},
"provider_request_id": {
"type": "string",
"maxLength": 200
},
"access": {
"type": "object",
"properties": {
"login_mode": {
"type": "string",
"enum": [
"instagram_login",
"facebook_login",
"threads_user"
]
},
"provider_host": {
"type": "string",
"maxLength": 200
},
"required_permissions": {
"maxItems": 16,
"type": "array",
"items": {
"type": "string",
"maxLength": 100
}
},
"current_connection_policy_permissions": {
"maxItems": 16,
"type": "array",
"items": {
"type": "string",
"maxLength": 100
}
},
"granted_permissions": {
"anyOf": [
{
"maxItems": 128,
"type": "array",
"items": {
"type": "string",
"maxLength": 100
}
},
{
"type": "null"
}
]
},
"grant_evidence": {
"type": "string",
"enum": [
"exact",
"unknown"
]
},
"permission_state": {
"type": "string",
"enum": [
"granted",
"missing",
"unknown"
]
},
"grant_observed_at": {
"type": "string",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"format": "date-time"
},
"app_access": {
"type": "string",
"const": "unverified"
},
"next_step": {
"type": "string",
"maxLength": 1500
}
},
"required": [
"login_mode",
"provider_host",
"required_permissions",
"current_connection_policy_permissions",
"granted_permissions",
"grant_evidence",
"permission_state",
"app_access",
"next_step"
],
"additionalProperties": false
}
},
"required": [
"http_status"
],
"additionalProperties": false
}
},
"required": [
"scope",
"status"
],
"additionalProperties": false
}
},
"provider_data": {
"anyOf": [
{},
{
"type": "null"
}
]
},
"requested_date_range": {
"anyOf": [
{
"type": "object",
"properties": {
"start_date": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"end_date": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
}
},
"required": [
"start_date",
"end_date"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"cache": {
"type": "object",
"properties": {
"authoritative": {
"type": "boolean",
"const": false
},
"status": {
"type": "string",
"enum": [
"stored",
"hit",
"bypassed"
]
},
"expires_at": {
"type": "string",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"format": "date-time"
}
},
"required": [
"authoritative",
"status",
"expires_at"
],
"additionalProperties": false
}
},
"required": [
"contract_version",
"request_id",
"platform",
"resource",
"provider_api_version",
"fetched_at",
"status",
"availability",
"provider_data",
"requested_date_range",
"cache"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"metrics": {
"maxItems": 5000,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"minLength": 1,
"maxLength": 150
},
"definition": {
"type": "string",
"minLength": 1,
"maxLength": 1000
},
"unit": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"grain": {
"type": "string",
"enum": [
"post",
"account"
]
},
"value": {
"type": [
"number",
"null"
]
},
"availability": {
"type": "string",
"enum": [
"available",
"partial",
"not_returned",
"unsupported",
"permission_required",
"threshold_not_met",
"no_data",
"failed",
"pending",
"stale"
]
},
"reason": {
"anyOf": [
{
"type": "string",
"maxLength": 4000
},
{
"type": "null"
}
]
},
"measurement": {
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"lifetime",
"snapshot",
"period",
"unknown"
]
},
"period": {
"anyOf": [
{
"type": "string",
"maxLength": 100
},
{
"type": "null"
}
]
},
"start": {
"anyOf": [
{
"type": "string",
"maxLength": 100
},
{
"type": "null"
}
]
},
"end": {
"anyOf": [
{
"type": "string",
"maxLength": 100
},
{
"type": "null"
}
]
},
"timezone": {
"anyOf": [
{
"type": "string",
"maxLength": 100
},
{
"type": "null"
}
]
}
},
"required": [
"kind",
"period",
"start",
"end",
"timezone"
],
"additionalProperties": false
},
"sourcePath": {
"type": "string",
"minLength": 1,
"maxLength": 2000
}
},
"required": [
"key",
"definition",
"unit",
"grain",
"value",
"availability",
"reason",
"measurement",
"sourcePath"
],
"additionalProperties": false
}
}
},
"required": [
"accountId",
"platform",
"resourceKind",
"providerResourceId",
"requestId",
"status",
"reason",
"envelope",
"metrics"
],
"additionalProperties": false
}
},
"coverage": {
"type": "object",
"properties": {
"population": {
"type": "string",
"const": "discovered_posts"
},
"postsComplete": {
"type": "boolean"
},
"nextCursor": {
"anyOf": [
{
"type": "string",
"maxLength": 16384
},
{
"type": "null"
}
]
},
"postLimit": {
"type": "integer",
"minimum": 0,
"maximum": 1000
},
"postInsightsLimit": {
"type": "integer",
"minimum": 0,
"maximum": 20
},
"omittedPostInsights": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"notes": {
"maxItems": 50,
"type": "array",
"items": {
"type": "string",
"maxLength": 2000
}
}
},
"required": [
"population",
"postsComplete",
"nextCursor",
"postLimit",
"postInsightsLimit",
"omittedPostInsights",
"notes"
],
"additionalProperties": false
},
"customMetrics": {
"maxItems": 50,
"type": "array",
"items": {
"type": "object",
"properties": {
"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)$"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"version": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"expression": {
"type": "string",
"minLength": 1,
"maxLength": 1000
},
"definition": {
"type": "string",
"maxLength": 1000
},
"unit": {
"type": "string",
"maxLength": 100
},
"grain": {
"type": "string",
"enum": [
"post",
"account",
"compatible_sum"
]
},
"rounding": {
"type": "object",
"properties": {
"decimalPlaces": {
"type": "integer",
"minimum": 0,
"maximum": 8
},
"mode": {
"type": "string",
"const": "half_away_from_zero"
}
},
"required": [
"decimalPlaces",
"mode"
],
"additionalProperties": false
},
"inputs": {
"maxItems": 5000,
"type": "array",
"items": {
"type": "object",
"properties": {
"requestId": {
"anyOf": [
{
"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)$"
},
{
"type": "null"
}
]
},
"sourcePath": {
"type": "string",
"maxLength": 2000
},
"value": {
"type": [
"number",
"null"
]
},
"availability": {
"type": "string",
"enum": [
"available",
"partial",
"not_returned",
"unsupported",
"permission_required",
"threshold_not_met",
"no_data",
"failed",
"pending",
"stale"
]
}
},
"required": [
"requestId",
"sourcePath",
"value",
"availability"
],
"additionalProperties": false
}
},
"value": {
"type": [
"number",
"null"
]
},
"availability": {
"type": "string",
"enum": [
"available",
"partial",
"not_returned",
"unsupported",
"permission_required",
"threshold_not_met",
"no_data",
"failed",
"pending",
"stale"
]
},
"reason": {
"anyOf": [
{
"type": "string",
"maxLength": 4000
},
{
"type": "null"
}
]
},
"formula": {
"type": "object",
"properties": {
"contractVersion": {
"type": "string",
"const": "analytics-metric/v1"
},
"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)$"
},
"workspaceId": {
"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)$"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"version": {
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
"expression": {
"type": "string",
"minLength": 1,
"maxLength": 1000
},
"fields": {
"maxItems": 32,
"type": "array",
"items": {
"type": "object",
"properties": {
"identifier": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]{0,63}$"
},
"selector": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"facebook",
"instagram",
"threads",
"youtube"
]
},
"key": {
"type": "string",
"pattern": "^[A-Za-z][A-Za-z0-9_]{0,100}$"
},
"definition": {
"type": "string",
"minLength": 1,
"maxLength": 500
},
"unit": {
"type": "string",
"enum": [
"count",
"seconds",
"minutes",
"percent",
"ratio"
]
},
"grain": {
"type": "string",
"enum": [
"post",
"account"
]
},
"measurementKind": {
"type": "string",
"enum": [
"lifetime",
"snapshot",
"period",
"unknown"
]
},
"nativePeriod": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64
},
{
"type": "null"
}
]
},
"timezone": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 100
},
{
"type": "null"
}
]
}
},
"required": [
"platform",
"key",
"definition",
"unit",
"grain",
"measurementKind",
"nativePeriod",
"timezone"
],
"additionalProperties": false
},
"aggregation": {
"type": "string",
"enum": [
"single",
"sum"
]
}
},
"required": [
"identifier",
"selector",
"aggregation"
],
"additionalProperties": false
}
},
"rounding": {
"type": "object",
"properties": {
"decimalPlaces": {
"type": "integer",
"minimum": 0,
"maximum": 8
},
"mode": {
"type": "string",
"const": "half_away_from_zero"
}
},
"required": [
"decimalPlaces",
"mode"
],
"additionalProperties": false
}
},
"required": [
"contractVersion",
"id",
"workspaceId",
"name",
"version",
"expression",
"fields",
"rounding"
],
"additionalProperties": false
},
"calculation": {
"type": "object",
"properties": {
"contractVersion": {
"type": "string",
"const": "analytics-metric/v1"
},
"workspaceId": {
"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)$"
},
"datasetId": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"formulaId": {
"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)$"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"version": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"expression": {
"type": "string",
"maxLength": 1000
},
"rounding": {
"type": "object",
"properties": {
"decimalPlaces": {
"type": "integer",
"minimum": 0,
"maximum": 8
},
"mode": {
"type": "string",
"const": "half_away_from_zero"
}
},
"required": [
"decimalPlaces",
"mode"
],
"additionalProperties": false
},
"value": {
"type": [
"number",
"null"
]
},
"unit": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"status": {
"type": "string",
"enum": [
"available",
"not_returned"
]
},
"code": {
"type": "string",
"enum": [
"ok",
"invalid_expression",
"missing_input",
"incompatible_input",
"zero_denominator",
"numeric_limit",
"workspace_mismatch",
"ambiguous_input",
"unknown_exclusion"
]
},
"reason": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 500
},
{
"type": "null"
}
]
},
"excludedInputIds": {
"maxItems": 5000,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 1500
}
},
"inputs": {
"maxItems": 5000,
"type": "array",
"items": {
"type": "object",
"properties": {
"inputId": {
"type": "string",
"minLength": 1,
"maxLength": 1500
},
"selector": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"facebook",
"instagram",
"threads",
"youtube"
]
},
"key": {
"type": "string",
"pattern": "^[A-Za-z][A-Za-z0-9_]{0,100}$"
},
"definition": {
"type": "string",
"minLength": 1,
"maxLength": 500
},
"unit": {
"type": "string",
"enum": [
"count",
"seconds",
"minutes",
"percent",
"ratio"
]
},
"grain": {
"type": "string",
"enum": [
"post",
"account"
]
},
"measurementKind": {
"type": "string",
"enum": [
"lifetime",
"snapshot",
"period",
"unknown"
]
},
"nativePeriod": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64
},
{
"type": "null"
}
]
},
"timezone": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 100
},
{
"type": "null"
}
]
}
},
"required": [
"platform",
"key",
"definition",
"unit",
"grain",
"measurementKind",
"nativePeriod",
"timezone"
],
"additionalProperties": false
},
"value": {
"type": [
"number",
"null"
]
},
"availability": {
"type": "string",
"enum": [
"available",
"partial",
"not_returned",
"unsupported",
"permission_required",
"threshold_not_met",
"no_data",
"failed",
"pending",
"stale"
]
},
"reason": {
"anyOf": [
{
"type": "string",
"maxLength": 8000
},
{
"type": "null"
}
]
},
"measurement": {
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"lifetime",
"snapshot",
"period",
"unknown"
]
},
"period": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64
},
{
"type": "null"
}
]
},
"start": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64
},
{
"type": "null"
}
]
},
"end": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64
},
{
"type": "null"
}
]
},
"timezone": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 100
},
{
"type": "null"
}
]
}
},
"required": [
"kind",
"period",
"start",
"end",
"timezone"
],
"additionalProperties": false
},
"requestId": {
"anyOf": [
{
"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)$"
},
{
"type": "null"
}
]
},
"sourcePath": {
"type": "string",
"minLength": 1,
"maxLength": 1000
},
"accountId": {
"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)$"
},
"providerResourceId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 512
},
{
"type": "null"
}
]
},
"fetchedAt": {
"anyOf": [
{
"type": "string",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"format": "date-time"
},
{
"type": "null"
}
]
},
"identifier": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]{0,63}$"
},
"included": {
"type": "boolean"
}
},
"required": [
"inputId",
"selector",
"value",
"availability",
"reason",
"measurement",
"requestId",
"sourcePath",
"accountId",
"providerResourceId",
"fetchedAt",
"identifier",
"included"
],
"additionalProperties": false
}
}
},
"required": [
"contractVersion",
"workspaceId",
"datasetId",
"formulaId",
"name",
"version",
"expression",
"rounding",
"value",
"unit",
"status",
"code",
"reason",
"excludedInputIds",
"inputs"
],
"additionalProperties": false
}
},
"required": [
"id",
"name",
"version",
"expression",
"definition",
"unit",
"grain",
"rounding",
"inputs",
"value",
"availability",
"reason"
],
"additionalProperties": false
}
}
},
"required": [
"contractVersion",
"id",
"reviewedAt",
"selection",
"accounts",
"posts",
"sources",
"coverage",
"customMetrics"
],
"additionalProperties": false
}
},
"required": [
"workspace_id",
"id",
"version",
"dataset"
],
"additionalProperties": false
}响应与完成
成功 HTTP 状态:200。操作完成时: synchronous_http_response.
成功 HTTP 响应可能表示请求已接受,并非已完成。背景工作请存储返回 ID,持续检查同一操作直到完成。已排程或已接受的帖子,只有平台确认后才算已发布;客户端逾时无法证明结果。
「必填」是指在其父对象及所选分支内必填。必填子字段不会使可选父对象变成必填。下列规则与字段名称均复制自契约。
| 字段 / 分支 | 类型 / 必填 | 约束 |
|---|---|---|
$ | object在父对象中必填 | — |
datasetId | string在父对象中必填 |
|
sourceSha256 | string在父对象中必填 |
|
fingerprint | string在父对象中必填 |
|
values | array在父对象中必填 |
|
values[] | object可选/项目 | — |
values[].name | string在父对象中必填 |
|
values[].required | boolean在父对象中必填 | — |
values[].kind | string | null在父对象中必填 | — |
values[].kindanyOf 1 | string在父对象中必填 |
|
values[].kindanyOf 2 | null在父对象中必填 | — |
values[].text | string在父对象中必填 | — |
values[].status | string在父对象中必填 |
|
values[].reason | string | null在父对象中必填 | — |
values[].rows | array可选/项目 | — |
values[].rows[] | array可选/项目 | — |
values[].rows[][] | string可选/项目 | — |
values[].chart | array可选/项目 | — |
values[].chart[] | object可选/项目 | — |
values[].chart[].label | string在父对象中必填 | — |
values[].chart[].value | number在父对象中必填 | — |
blocking | array在父对象中必填 | — |
blocking[] | string可选/项目 | — |
warnings | array在父对象中必填 | — |
warnings[] | string可选/项目 | — |
完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"datasetId": {
"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)$"
},
"sourceSha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"fingerprint": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"values": {
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 64
},
"required": {
"type": "boolean"
},
"kind": {
"anyOf": [
{
"type": "string",
"enum": [
"text",
"selection",
"metric",
"formula",
"table",
"chart"
]
},
{
"type": "null"
}
]
},
"text": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"resolved",
"missing",
"unavailable"
]
},
"reason": {
"type": [
"string",
"null"
]
},
"rows": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
"chart": {
"type": "array",
"items": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"value": {
"type": "number"
}
},
"required": [
"label",
"value"
]
}
}
},
"required": [
"name",
"required",
"kind",
"text",
"status",
"reason"
]
}
},
"blocking": {
"type": "array",
"items": {
"type": "string"
}
},
"warnings": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"datasetId",
"sourceSha256",
"fingerprint",
"values",
"blocking",
"warnings"
]
}错误与安全重试
检查 HTTP 状态和响应正文。400 验证错误可能包含 ZodError;处理程序错误使用 error、message 和 code 字段。保留 request_id 或 x-request-id 以便诊断,但不要保留凭证。先解决 401/403 访问错误再重试,并在收到 429 时遵循 Retry-After。如写入结果不确定或返回 5xx,先读取现有结果。仅在支持时复用幂等键;重试行为因操作而异,并不保证恰好交付一次。
故障排查指南示例
这些示例使用已依schema检查的虚构值。请将 ID 替换为你有权使用的 ID、将媒体替换为已就绪素材,并将日期替换为已确认的发布时间。提交写入前,请检查账号资格。本页不会发送 API 请求。
在服务器上将 SOSOAPI_ACCESS_TOKEN 设为此操作接受的凭证,且不要放入浏览器代码。agent 请使用 sosoapi auth login 通过浏览器登录,并由 CLI 更新凭证。
request.json
{
"workspace_id": "11111111-1111-4111-8111-111111111111",
"id": "11111111-1111-4111-8111-111111111111",
"version": 1,
"dataset": {
"contractVersion": "analytics-report/v1",
"id": "11111111-1111-4111-8111-111111111111",
"reviewedAt": "2099-01-15T09:00:00Z",
"selection": {
"workspaceId": "11111111-1111-4111-8111-111111111111",
"accountIds": [
"11111111-1111-4111-8111-111111111111"
],
"platforms": [
"facebook"
],
"startDate": "2099-01-15",
"endDate": "2099-01-15",
"timezone": "UTC"
},
"accounts": [
{
"id": "11111111-1111-4111-8111-111111111111",
"workspaceId": "11111111-1111-4111-8111-111111111111",
"platform": "facebook",
"name": "Fictional report account"
}
],
"posts": [],
"sources": [],
"coverage": {
"population": "discovered_posts",
"postsComplete": false,
"nextCursor": null,
"postLimit": 0,
"postInsightsLimit": 0,
"omittedPostInsights": 0,
"notes": []
},
"customMetrics": []
}
}cURL
curl --request POST \
"https://gqeshlawtcexsapabaui.supabase.co/functions/v1/analytics-api/reporting/templates/preview" \
-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/analytics-api/reporting/templates/preview", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer " + token },
body: JSON.stringify({
"workspace_id": "11111111-1111-4111-8111-111111111111",
"id": "11111111-1111-4111-8111-111111111111",
"version": 1,
"dataset": {
"contractVersion": "analytics-report/v1",
"id": "11111111-1111-4111-8111-111111111111",
"reviewedAt": "2099-01-15T09:00:00Z",
"selection": {
"workspaceId": "11111111-1111-4111-8111-111111111111",
"accountIds": [
"11111111-1111-4111-8111-111111111111"
],
"platforms": [
"facebook"
],
"startDate": "2099-01-15",
"endDate": "2099-01-15",
"timezone": "UTC"
},
"accounts": [
{
"id": "11111111-1111-4111-8111-111111111111",
"workspaceId": "11111111-1111-4111-8111-111111111111",
"platform": "facebook",
"name": "Fictional report account"
}
],
"posts": [],
"sources": [],
"coverage": {
"population": "discovered_posts",
"postsComplete": false,
"nextCursor": null,
"postLimit": 0,
"postInsightsLimit": 0,
"omittedPostInsights": 0,
"notes": []
},
"customMetrics": []
}
})
});
const result = await response.json();
// Check response.ok, the operation-specific body and completion state before continuing.CLI
npx sosoapi api post /analytics-api/reporting/templates/preview < request.json合成响应示例
{
"datasetId": "11111111-1111-4111-8111-111111111111",
"sourceSha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"fingerprint": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"values": [],
"blocking": [],
"warnings": []
}