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

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 的使用者設置為顯示語言的語言
    如果語言設置為「與網路瀏覽器設定相同」,則要獲取的語言取決於是否存在「Accept-Language」標頭。
    • 帶標題:帶標頭:「Accept-Language」標頭中指定的語言
    • 無標頭:在通用管理的地區設定中設置 cybozu.com 語言
      地區設定 (External link)
  • 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值。
  • 對於「USER」:用戶的登入名稱
  • 對於「GROUP」:群組代碼
  • 對於「ORGANIZATION」:組織代碼
  • FIELD_ENTITY',在「選擇表單中的欄位」中指定的欄位
如果您是訪客使用者,則您的登錄名前面有「guest/」。
notifications[].targets[].includeSubs 布爾值 設置是否由子單位繼承
  • true:繼承
  • false:不繼承
僅當entity.type為「ORGANIZATION」或「FIELD_ENTITY」並指定了組織選擇字段時,才會返回「false」。
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.api()請求使用

有關詳細的kintone.api(),請參閱以下頁面。
發送kintone REST 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);