獲取應用的圖表設置

information

本頁面使用機器翻譯而成。
機器翻譯免責聲明 (External link)

目錄

獲取應用的圖表設置

獲取應用圖表的設置。
如果您的應用中存在同名圖表,則運行此 API 將導致錯誤。

URL

獲取生產環境的設置時,URL 與獲取測試環境的設置時不同。

如果要獲取生產環境的設置
常規應用
https://sample.cybozu.com/k/v1/app/reports.json
建立訪客空間
https://sample.cybozu.com/k/guest/GUEST_SPACE_ID/v1/app/reports.json
獲取操作測試環境的設置
常規應用
https://sample.cybozu.com/k/v1/preview/app/reports.json
建立訪客空間
https://sample.cybozu.com/k/guest/GUEST_SPACE_ID/v1/preview/app/reports.json

HTTP 方法

GET

所需許可權

  • 應用程式管理

請求

參數
參數名稱 必須 說明
app 數位或字串 必須 應用ID
lang 字串 自選 要檢索的名稱的語言
指定欄位或選項的名稱是否設置為 每種語言的名稱 (External link)
  • ja:日本語
  • en:英語
  • zh:中文
  • user:執行 API 的使用者設置為顯示語言的語言
    如果語言設置為"遵循 Web 瀏覽器設置",則要檢索的語言取決於是否存在"Accept-Language"標頭。
    • 帶標頭:「Accept-Language」標頭中指定的語言
    • 無標頭:在通用管理的「 區域設置 (External link) 」中設置 cybozu.com 語言
  • default:預設
如果省略,則獲取預設名稱。
範例請求(如果要在網址中包含參數 )
URL

https://sample.cybozu.com/k/v1/app/reports.json?app=1&lang=ja

頁眉
1
2
3
{
  "X-Cybozu-API-Token": "API_TOKEN"
}

關於請求頭,請參見 kintone REST API的通用規範

範例要求(如果要在要求正文中包含參數)
URL

https://sample.cybozu.com/k/v1/app/reports.json

頁眉
1
2
3
4
{
  "X-Cybozu-API-Token": "API_TOKEN",
  "Content-Type": "application/json"
}

關於請求頭,請參見 kintone REST API的通用規範

身體
1
2
3
4
{
  "app": "1",
  "lang": "ja"
}

回應

財產
屬性名稱 說明
reports 物件 圖形資訊
reports.圖形名稱 物件 每個圖表的資訊
圖形名稱 始終返回預設名稱,而不考慮運行 API 的使用者的顯示語言設置。
reports.圖形名稱.chartType 字串 圖表類型
  • BAR:橫條圖
  • COLUMN:直條圖
  • PIE:圓形圖
  • LINE:折線圖
  • PIVOT_TABLE:交叉資料表
  • TABLE:表
  • AREA:面積圖
  • SPLINE:曲線圖
  • SPLINE_AREA:曲面圖
reports.圖形名稱.chartMode 字串 圖形顯示模式
  • NORMAL
    • chartType 如果是"BAR"或"COLUMN",則將
    • chartType 如果是"AREA"或"SPLINE_AREA":不堆疊
  • STACKED:堆疊
  • PERCENTAGE:百分比堆疊
chartType 僅當 "BAR"、"COLUMN"、"AREA" 或 "SPLINE_AREA" 時返回。
reports.圖形名稱.id 字串 圖形ID
reports.圖形名稱.name 字串 圖表名稱
lang ,則返回執行 API 的使用者的顯示語言名稱。
reports.圖形名稱.index 字串 圖形排序順序
從 0 開始。
reports.圖形名稱.groups 陣列 要分類的項目清單
僅返回設置的專案。順序從上到下:大、中、小專案。
reports.圖形名稱.groups[].code 字串 要分類的物料的域代碼
reports.圖形名稱.groups[].per 字串 要分類的項目的時間單位
  • YEAR:年為單位
  • QUARTER:以季度為單位
  • MONTH:以月為單位
  • WEEK:以週為單位
  • DAY:以日為單位
  • HOUR:以小時為單位
  • MINUTE:分鐘單位
groups[].code 僅當在 中指定了以下欄位時才返回。
  • 建立時間
  • 更新時間
  • 日期與時間
  • 日期:僅限年、季度、月、周和日
  • 時間:僅適用於"小時"和"分鐘"
如果設置了"--"(無單位),則返回最小的時間單位。
reports.圖形名稱.aggregations 陣列 聚合方法清單
reports.圖形名稱.aggregations[].type 字串 聚合方法的類型
  • COUNT:記錄數
  • SUM:合計
  • AVERAGE:平均
  • MAX:最大
  • MIN:最小
reports.圖形名稱.aggregations[].code 字串 要聚合的域代碼
aggregations[].type 當為「COUNT」時不返回。
reports.圖形名稱.filterCond 字串 篩選條件
它以查詢的形式表示。有關查詢格式, 請參閱如何 編寫查詢。
如果指定了已刪除的使用者/組織/組,則返回錯誤。
reports.圖形名稱.sorts 陣列 排序列表
reports.圖形名稱.sorts[].by 字串 排序方式
  • TOTAL:匯總值
  • GROUP1:大項目
  • GROUP2:中項目
  • GROUP3:小項目
reports.圖形名稱.sorts[].order 字串 排序順序
  • ASC:遞增
  • DESC:遞減
reports.圖形名稱.periodicReport 物件 設置定期報告
如果未配置計劃報表,則返回 null。
reports.圖形名稱.periodicReport.active 布爾值 定期報告的執行情況
  • true:執行中
  • false:停用中
reports.圖形名稱.periodicReport.period 物件 定期報告的聚合間隔
reports.圖形名稱.periodicReport.period.every 字串 定期報告的聚合間隔類型
  • YEAR:每年
  • QUARTER:每季度
  • MONTH:每月
  • WEEK:每週
  • DAY:每天
  • HOUR:每小時
reports.圖形名稱.periodicReport.period.month 字串 執行聚合的月份
該值是介於 1 和 12 之間的整數。
periodicReport.period.every 僅當為"YEAR"時返回。
reports.圖形名稱.periodicReport.period.time 字串 一天中要執行聚合的時間
格式為「HH:mm」格式。
periodicReport.period.every 僅當 「YEAR」、"QUARTER"、"MONTH"、"WEEK" 或 "DAY" 時返回。
reports.圖形名稱.periodicReport.period.pattern 字串 執行季度匯總的月份
  • JAN_APR_JUL_OCT: 1月、4月、7月、10月
  • FEB_MAY_AUG_NOV: 2月、5月、8月、11月
  • MAR_JUN_SEP_DEC: 3月、6月、9月、12月
periodicReport.period.every 是"QUARTER"。
reports.圖形名稱.periodicReport.period.dayOfMonth 字串 聚合日期
  • 介於 1 和 31 之間的整數
  • END_OF_MONTH:月底
    periodicReport.period.every 什麼時候是"QUARTER"或"MONTH"
periodicReport.period.every 僅當它為"YEAR"、"QUARTER"或"MONTH"時才返回。
reports.圖形名稱.periodicReport.period.dayOfWeek 字串 要進行聚合的星期幾
  • SUNDAY
  • MONDAY
  • TUESDAY
  • WEDNESDAY
  • THURSDAY
  • FRIDAY
  • SATURDAY
periodicReport.period.every 僅當為「WEEK」時返回。
reports.圖形名稱.periodicReport.period.minute 字串 執行聚合的分鐘數
  • 0
  • 10
  • 20
  • 30
  • 40
  • 50
periodicReport.period.every 僅當 「HOUR」 時返回。
revision 字串 應用設置的修訂號
示例回應
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{
  "reports": {
    "初期設定": {
      "id": "7319",
      "chartType": "BAR",
      "chartMode": "NORMAL",
      "name": "初期設定",
      "index": "0",
      "groups": [
        {
          "code": "選項按鈕_0",
        }
      ],
      "aggregations": [
        {
          "type": "COUNT"
        }
      ],
      "filterCond": "",
      "sorts": [
        {
          "by": "TOTAL",
          "order": "DESC"
        }
      ],
      "periodicReport": null
    },
    "様々なグラフの設定": {
      "id": "7321",
      "chartType": "TABLE",
      "name": "様々なグラフの設定",
      "index": "1",
      "groups": [
        {
          "code": "選項按鈕_0",
        },
        {
          "code": "建立時間_0",
          "per": "YEAR"
        },
        {
          "code": "時刻_0",
          "per": "MINUTE"
        }
      ],
      "aggregations": [
        {
          "type": "COUNT"
        },
        {
          "type": "SUM",
          "code": "數值_0",
        },
        {
          "type": "AVERAGE",
          "code": "計算_0",
        },
        {
          "type": "MAX",
          "code": "建立時間_0",
        },
        {
          "type": "MIN",
          "code": "時刻_0"
        }
      ],
      "filterCond": "記錄編號 = \"1\" and 文字編輯方塊_0 like \"aaa\"",
      "sorts": [
        {
          "by": "TOTAL",
          "order": "DESC"
        },
        {
          "by": "GROUP1",
          "order": "ASC"
        },
        {
          "by": "GROUP2",
          "order": "DESC"
        }
      ],
      "periodicReport": null
    },
    "定期レポートON": {
      "id": "7323",
      "chartType": "BAR",
      "chartMode": "NORMAL",
      "name": "定期レポートON",
      "index": "2",
      "groups": [
        {
          "code": "選項按鈕_0",
        }
      ],
      "aggregations": [
        {
          "type": "COUNT"
        }
      ],
      "filterCond": "",
      "sorts": [
        {
          "by": "TOTAL",
          "order": "DESC"
        }
      ],
      "periodicReport": {
        "active": true,
        "period": {
          "every": "QUARTER",
          "pattern": "JAN_APR_JUL_OCT",
          "dayOfMonth": "END_OF_MONTH",
          "time": "23:30"
        }
      }
    }
  },
  "revision": "77"
}

示例代碼

使用 curl 的請求
1
2
3
4
5
6
7
curl -X GET 'https://sample.cybozu.com/k/v1/app/reports.json' \
  -H 'X-Cybozu-API-Token: API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "app": 1,
    "lang": "ja"
  }'
發送kintone REST API請求 使用API發送請求
1
2
3
4
5
6
const body = {
  app: kintone.app.getId(),
  lang: 'ja'
};

await kintone.api(kintone.api.url('/k/v1/app/reports.json', true), 'GET', body);