Update Reminder Notification Settings

Updates the Reminder Notification (External link) settings of the App.

This API updates the pre-live settings. After using this API, use the Deploy App Settings API to deploy the settings to the live App.

MethodPUT
URLhttps://{subdomain}.kintone.com/k/v1/preview/app/notifications/reminder.json
URL(guest space)https://{subdomain}.kintone.com/k/guest/{SpaceID}/v1/preview/app/notifications/reminder.json
Authentication Password Authentication, API Token Authentication, Session Authentication
Content-Typeapplication/json

Contents

Permissions

  • App Management Permissions are needed.
  • The entity must be granted the view records permission in order for the entity to receive the notification.

Request Parameters

Parameter Value Required Description
app Integer or String Yes The App ID.
notifications Array An array of objects consisting of "Notification Trigger" options. These options define when the notifications will be sent out, under what conditions, and the recipients.
If an empty array is sent, all the recipients will be removed.
If this parameter is ignored, no changes will be made to the "Notification Trigger" options.
notifications[].timing Object Conditional An object containing the Reminder notification's timing.
Required when specifying the notifications parameter.
notifications[].timing.code String Conditional The field code of the field used to determine the Reminder notification's timing.
The field code of the following fields can be used:
  • Created datetime
  • Updated datetime
  • Date
  • Date and time
Required when specifying the notifications[].timing parameter.
notifications[].timing.daysLater Integer or String Conditional The number of days after the notifications[].timing.code date/datetime when the Reminder notification is sent.
Input a negative value for the number of days before the notifications[].timing.code date/datetime.
The value must be between -10000 and 10000.
Required when specifying the notifications[].timing parameter.
notifications[].timing.hoursLater Integer or String Conditional The number of hours after the notifications[].timing.code datetime shifted by daysLater when the Reminder notification is sent.
Input a negative value for the number of hours before the notifications[].timing.code datetime.
The value must be between -10000 and 10000.
Required when specifying the notifications[].timing parameter and not specifying the notifications[].timing.time parameter.
notifications[].timing.time String Conditional The time when the Reminder notification is sent.
Input the time in HH:MM format.
MM must be "00", "10", "20", "30", "40" or "50".
Examples: "09:00", "14:30", or "23:50"
Required when specifying the notifications[].timing parameter and not specifying the notifications[].timing.hoursLater parameter.
notifications[].filterCond String The record's filter condition in query string format.
For more information, refer to the Sample Requests (Query String) section.
The following cases will have the same result:
  • "All records" is specified.
  • "null" is specified.
  • An empty string is specified.
  • The parameter is ignored.
The request will fail if a deleted User, Group, or Organization is specified in the filter condition.
notifications[].title String The notification subject that is saved under "Summary".
The maximum limit is 100 characters.
If ignored, the notification subject will be an empty string.
notifications[].targets Array Conditional An array of objects containing the recipients of the Reminder Notification.
Required when specifying the notifications parameter.
notifications[].targets[].entity Object Conditional An object containing entity details per recipient of the Reminder Notification.
Required when specifying the notifications[].targets parameter.
notifications[].targets[].entity.type String Conditional The type of the entity the Reminder Notification settings are configured to.
  • USER: User
  • GROUP: Group
  • ORGANIZATION: Department
  • FIELD_ENTITY: Created By, Updated By, User Selection, Group Selection, and Department Selection Fields
For Apps in a guest space, specifying a Department will result in an error.
Required when specifying the notifications[].targets[].entity parameter.
notifications[].targets[].entity.code String Conditional The code of the entity the Reminder Notification settings are configured to.
Specify the field code if the notifications[].targets[].entity.type parameter is specified as FIELD_ENTITY.
For guest users, the login name is preceded by guest/.
Required when specifying the notifications[].targets[].entity parameter.
notifications[].targets[].includeSubs Boolean or String The "Include affiliated departments" setting of the Department. This parameter is available if notifications[].targets[].entity.type parameter is specified to ORGANIZATION or FIELD_ENTITY.
  • true: Affiliated departments do inherit the Reminder Notification settings
  • false: Affiliated departments do not inherit the Reminder Notification settings
If ignored, this value is false.
timezone String The timezone that determines the Reminder notification's timing. This reflects the "Reminder Time Zone" dropdown option.
If the App's Reminder Notification settings have never been configured, the API executing user's timezone will be used.
revision Integer or String Specify the revision number of the settings that will be deployed.
The request will fail if the revision number is not the latest revision.
The revision will not be checked if this parameter is ignored or -1 is specified.

Sample Request

JavaScript (using Kintone REST API Request)

 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
var body = {
  'app': kintone.app.getId(),
  'notifications': [{
    'timing': {
      'code': 'Deadline_Date',
      'daysLater': '-1',
      'time': '09:00'
    },
    'filterCond': 'User_selection in ("USER", "user1")',
    'title': 'Reminder: Tomorrow is the deadline',
    'targets': [{
      'entity': {
        'type': 'USER',
        'code': 'user1'
      },
      'includeSubs': false
    }]
  },
  {
    'timing': {
      'code': 'Created_datetime',
      'daysLater': '1',
      'hoursLater': '2'
    },
    'filterCond': 'User_selection in ("USER", "user1")',
    'title': 'Reminder: Yesterday\'s records',
    'targets': [{
      'entity': {
        'type': 'USER',
        'code': 'user1'
      },
      'includeSubs': false
    }]
  }
  ],
  'timezone': 'America/Los_Angeles',
  'revision': '2'
};

kintone.api(kintone.api.url('/k/v1/preview/app/notifications/reminder.json', true), 'PUT', body, function(resp) {
  // success
  console.log(resp);
}, function(error) {
  // error
  console.log(error);
});

XMLHttpRequest

 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
var body = {
  'app': kintone.app.getId(),
  'notifications': [{
    'timing': {
      'code': 'Deadline_Date',
      'daysLater': '-1',
      'time': '09:00'
    },
    'filterCond': 'User_selection in ("USER", "user1")',
    'title': 'Reminder: Tomorrow is the deadline',
    'targets': [{
      'entity': {
        'type': 'USER',
        'code': 'user1'
      },
      'includeSubs': false
    }]
  },
  {
    'timing': {
      'code': 'Created_datetime',
      'daysLater': '1',
      'hoursLater': '2'
    },
    'filterCond': 'User_selection in ("USER", "user1")',
    'title': 'Reminder: Yesterday\'s records',
    'targets': [{
      'entity': {
        'type': 'USER',
        'code': 'user1'
      },
      'includeSubs': false
    }]
  }
  ],
  'timezone': 'America/Los_Angeles',
  'revision': '2',
  // CSRF TOKEN: used for all APIs that have an HTTP method of POST, PUT, and DELETE on Kintone.
  '__REQUEST_TOKEN__': kintone.getRequestToken()
};

var url = 'https://{subdomain}.kintone.com/k/v1/preview/app/notifications/reminder.json';
var xhr = new XMLHttpRequest();
xhr.open('PUT', url);
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onload = function() {
  if (xhr.status === 200) {
    // success
    console.log(JSON.parse(xhr.responseText));
  } else {
    // error
    console.log(JSON.parse(xhr.responseText));
  }
};
xhr.send(JSON.stringify(body));

Response Parameters

Parameter Type Description
revision String The revision number of the App settings.

Sample Response

1
2
3
{
  "revision": "2"
}