Group and total a register's rows.
POST/api/v1/custom-field-templates/{custom_field_template_id}/rows/aggregateregisters:read
注記
このページの操作の説明は、API の OpenAPI 文書のとおり英語で記載しています。
The Portal's chart data over the register rows the caller can read: filter (eq, neq, gt, lt, gte, lte, between, in, contains; the values today, now, yesterday, tomorrow, this_week_start, this_month_start and this_year_start stand for dates), group by any number of fields, take metrics (count, sum, avg, min, max over a field), order and limit. Each answer group holds its value of every group_by field (by custom_field_id) and every metric (by name). owner narrows the rows to one document's.
| スコープ | registers:read |
| 非同期 | いいえ |
| MCP ツール | aggregate_custom_field_template_rows |
| Portal の権限 | view_custom_field_values |
パラメーター
| 名前 | 場所 | 型 | 必須 | 説明 |
|---|---|---|---|---|
custom_field_template_id | path | string | 必須 | |
Docwize-Version | header | string (date) | 任意 |
リクエスト本文
| Content-Type | 型 |
|---|---|
application/json | RegisterAggregateInput |
応答
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Success. | application/json RegisterAggregateResult |
400 | invalid_version, malformed_json | application/problem+json Problem |
401 | token_expired, unauthenticated | application/problem+json Problem |
403 | forbidden, insufficient_scope, token_owner_inactive | application/problem+json Problem |
404 | not_found | application/problem+json Problem |
405 | method_not_allowed | application/problem+json Problem |
406 | not_acceptable | application/problem+json Problem |
413 | payload_too_large | application/problem+json Problem |
415 | unsupported_media_type | application/problem+json Problem |
421 | wrong_region | application/problem+json Problem |
422 | validation_failed | application/problem+json Problem |
500 | internal_error | application/problem+json Problem |
503 | tenant_unavailable, unavailable | application/problem+json Problem |
504 | timeout | application/problem+json Problem |
エラー
この操作が返す可能性のある problem のコードです。各コードからそのページに移動できます。
スキーマ
RegisterAggregateFilterInput
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
custom_field_id | string | 必須 | |
operator | string | 必須 | eq, neq, gt, lt, gte, lte, between, in or contains. |
value | string または null | 任意 | The value to compare with, as text: a number as decimal text, a date as YYYY-MM-DD (or today, now, yesterday, tomorrow, this_week_start, this_month_start, this_year_start). For every operator except in and between. |
values | string の配列 | 任意 | The values for in (one or more) and between (exactly two: from, to), as value gives them. |
RegisterAggregateGroup
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
group | object | 必須 | The group's value of each group_by field, keyed by the field's custom_field_id; null for rows with no value. Decimals are text, dates ISO text. |
values | object | 必須 | The group's metrics, keyed by the metric's name. count is a number; the others are decimal text, or null when the group has no value. |
RegisterAggregateInput
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
filters | RegisterAggregateFilterInput の配列 | 任意 | Conditions every row must meet (all of them). |
group_by | string の配列 | 任意 | The fields the rows are grouped by, in this order; none gives one group of every row. |
limit | integer または null | 任意 | The most groups to answer; all of them when absent. has_more says whether more existed. |
metrics | RegisterAggregateMetricInput の配列 | 任意 | What to total in each group; a count by default. |
order_by | RegisterAggregateOrderInput の配列 | 任意 | The order of the groups. |
owner | RowOwnerWriteInput または null | 任意 | Only the rows of this document (type document); you must be able to read it. |
RegisterAggregateMetricInput
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
custom_field_id | string または null | 任意 | The field the function is taken over: required except for count, which counts the group's rows (with a field, the rows that have a value in it). sum and avg need a numeric field. |
function | string | 必須 | count, sum, avg, min or max. |
name | string または null | 任意 | The key the answer holds this metric's value under; the function's name by default. Names are unique in a request. |
RegisterAggregateOrderInput
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
custom_field_id | string または null | 任意 | A field named in group_by. |
direction | string または null | 任意 | asc (the default) or desc. |
metric | string または null | 任意 | The name of a metric. Exactly one of metric and custom_field_id. |
RegisterAggregateResult
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
groups | RegisterAggregateGroup の配列 | 必須 | |
has_more | boolean | 必須 | Whether more groups existed beyond the limit. |
RowOwnerWriteInput
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
document_id | string または null | 任意 | The document's ID, for type document. |
type | string | 必須 | document (the only owner a row write takes). |