獲取提醒條件通知的設置

information

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

目錄

獲取提醒條件通知的設置

獲取提醒的條件通知的設置。

URL

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

如果要獲取生產環境的設置
常規應用
https://sample.cybozu.com/k/v1/app/notifications/reminder.json
建立訪客空間
https://sample.cybozu.com/k/guest/GUEST_SPACE_ID/v1/app/notifications/reminder.json
獲取操作測試環境的設置
常規應用
https://sample.cybozu.com/k/v1/preview/app/notifications/reminder.json
建立訪客空間
https://sample.cybozu.com/k/guest/GUEST_SPACE_ID/v1/preview/app/notifications/reminder.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/notifications/reminder.json?app=1&lang=ja

頁眉
1
2
3
{
  "X-Cybozu-Authorization": "QWRtaW5pc3RyYXRvcjpjeWJvenU="
}

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

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

https://sample.cybozu.com/k/v1/app/notifications/reminder.json

頁眉
1
2
3
4
{
  "X-Cybozu-Authorization": "QWRtaW5pc3RyYXRvcjpjeWJvenU=",
  "Content-Type": "application/json"
}
身體
1
2
3
4
{
  "app": "1",
  "lang": "ja"
}

回應

財產
屬性名稱 說明
notifications 陣列 設定通知條件(提醒)
notifications[].timing 物件 通知時間
notifications[].timing.code 字串 用作通知時間的參考日期和時間的欄位的欄位代碼
notifications[].timing.daysLater 字串 參考日期和時間之前或之後的多少天或幾天將收到通知?
如果要在引用日期和時間之前通知,則返回負整數。
notifications[].timing.hoursLater 字串 從添加到基準日期和時間 timing.daysLater 的日期和時間中,應提前多少小時或小時通知?
timing.code 指定一個表示日期和時間的字段,如果設置了"指定相對時間",則返回一個值。
如果早於引用日期和時間,則返回負整數。
notifications[].timing.time 字串 從添加到基準日期和 timing.daysLater 時間的日期開始何時通知
在以下情況之一中返回值:
  • timing.code 如果您在
  • timing.code 在中指定了表示日期和時間的欄位並設置了「指定絕對時間」 時
notifications[].filterCond 字串 提醒條件通知條件
它以查詢的形式表示。有關查詢格式, 請參閱如何 編寫查詢。
如果指定了已刪除的使用者/組織/組,則返回錯誤。
notifications[].title 字串 提醒條件通知中通知了哪些內容
notifications[].targets 陣列 通知收件人名單
notifications[].targets[].entity 物件 一個表示通知目標的物件
notifications[].targets[].entity.type 字串 通知收件者的類型
  • USER:使用者
  • GROUP:群組
  • ORGANIZATION:組織
  • FIELD_ENTITY:通知目標欄位中指定的欄位
    • 建立人
    • 更新人
    • 選擇使用者
    • 選擇組織
    • 選擇群組
notifications[].targets[].entity.code 字串 通知目標目標的代碼
entity.type 這取決於的值。
  • 對於"使用者":用戶的登錄名
  • 對於"GROUP":組代碼
  • 對於"ORGANIZATION":組織代碼
  • 對於FIELD_ENTITY:在添加表單欄位中指定的欄位的欄位代碼
如果您是訪客使用者,則您的登錄名前面有"guest/"。
notifications[].targets[].includeSubs 布爾值 設置是否由子單位繼承
  • true:繼承
  • false:不繼承
entity.type 僅當指定了組織選擇字段時,才返回"ORGANIZATION"或"FIELD_ENTITY"。
timezone 字串 提醒時間的時區
從未設置提醒條件通知的應用將返回「null」。
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
{
  "notifications": [
    {
      "timing": {
        "code": "建立時間",
        "daysLater": "1",
        "hoursLater": "2"
      },
      "filterCond": "選擇使用者_0 in (\"user1\")",
      "title": "リマインドです",
      "targets": [
        {
          "entity": {
            "type": "USER",
            "code": "user1"
          },
          "includeSubs": false
        }
      ]
    },
    {
      "timing": {
        "code": "建立時間",
        "daysLater": "-3",
        "time": "08:30"
      },
      "filterCond": "選擇使用者_0 in (\"user1\")",
      "title": "リマインドです",
      "targets": [
        {
          "entity": {
            "type": "USER",
            "code": "user1"
          },
          "includeSubs": false
        }
      ]
    }
  ],
  "timezone": "Asia/Tokyo",
  "revision": "2"
}

示例代碼

使用 curl 的請求
1
2
3
4
5
6
7
curl -X GET 'https://sample.cybozu.com/k/v1/app/notifications/reminder.json' \
-H 'X-Cybozu-Authorization: QWRtaW5pc3RyYXRvcjpjeWJvenU=' \
-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/notifications/reminder.json', true), 'GET', body);