API Updates for May 2016

API Updates

Kintone will be holding a scheduled maintenance update on May 6th 2016.

Kintone REST API

New features

  • Feature for updating records with the Update Record (PUT) API by specifying a key other than Record number.
    Records in an app can be updated by specifying either the Record number or another unique key. The update key should be either a Single-line text or Number field type. Fields in Tables cannot be used as the update key.
  • New APIs
    • Get Comments API
      Comments can be retrieved from a record by specifying an App ID and Record ID.
    • Add Comment API
      A comment can be added to a record by specifying an App ID and Record ID. Users can also be mentioned by using this API.
    • Delete Comment API
      A comment can be deleted from a record by specifying an App ID, Record ID, and Comment ID.
    • Update Assignees API
      Assignees of a record can be updated with user authentication or API tokens that have permission to both manage the app and view records. To update the status, use the Update Status API.
  • API Token Authentication support for the Bulk Request API
    The Bulk request API can be used via API Token Authentication.
  • Feature for specifying the number of days before/after today on date based filters
    The following function is added to the query parameter for the Get Records API.
    • From today: FROM_TODAY(number, period)
      DAYS/WEEKS/MONTHS/YEARS can be specified for the period.
  • Feature for specifying the day of the week for this/last week on date based filters
    The following function is added to the query parameter for the Get Records API.
    • This week: THIS_WEEK()
      Note: Sunday of this week will be THIS_WEEK("SUNDAY").
    • Last week: LAST_WEEK()
      Note: Sunday of last week will be LAST_WEEK("SUNDAY").
  • Feature for specifying the day of the month for this/last month on date based filters
    The following parameters can be used with the THIS_MONTH and LAST_MONTH functions in the query parameter for the Get Records API
    • End of this month: THIS_MONTH(LAST)
    • Date of this month: THIS_MONTH(number)
  • Added function for specifying a user's Priority Department when filtering a Department Selection field
    The PRIMARY_ORGANIZATION() is added to the query parameter for the Get Records API.

Spec changes

  • The priority of the authentication method will change.
    • Before: Authentication priority is in order of Session Authentication, Password Authentication, API Token Authentication.
    • After: Authentication priority is in order of Password Authentication, API Token Authentication, Session Authentication.

The above change will have an impact on users who are customizing Kintone in the following ways:

  • Impact on customizations run by XHR requests, such as jQuery's $a.jax, instead of using kintone.api()
    • When the X-Cybozu-Authorization header of the password authentication settings is incorrect, (e.g. using a non-existing user or an incorrect password)
      • Before: Session authentication succeeds, and the API will run.
      • After: Password authentication fails, and the API will result in an error.
    • When the X-Cybozu-API-Token header of the API token Authentication setting is incorrect, (e.g. using an incorrect API Token)
      • Before: Session authentication succeeds, and the API will run.
      • After: API token Authentication fails, and the API will result in an error.
    • When the correct password authentication header is set,
      • Before: Session authentication succeeds, and the API will be run by the user authenticated by the session authentication.
      • After: Password authentication succeeds, and the API will be run by the user authenticated by the password authentication.
    • When the correct API token authentication header is set,
      • Before: Session authentication succeeds, and the API will be run by the user authenticated by the session authentication.
      • After: API token authentication succeeds, and the API will be run by Administrator.
  • Possible impact on customizations with external programs
    • When the incorrect password authentication header and the correct API token authentication header is set
      • Before: API token authentication will succeed, and the API will run.
      • After: Password authentication will succeed, and the API will result in an error.

Bug fixes

  • A bug occurs when filtering conditions produce more than one hundred thousand records and was uses "AND".
    • Before the fix: An error message will be displayed, and no records will be shown in the result.
    • After the fix: An error message will be displayed and up to one hundred thousand records will be shown in the result. Or else, an error message stating that the number of records in the results exceeds the limit of one hundred thousand records will be displayed.
  • A bug occors when a field used for the sort order in the query parameter of the Get Record API is deleted.
    • Before the fix: An error message is shown.
    • After the fix: The field is ignored, and the correct result is returned.
  • A bug occurs when the Get Records API or the Update Records API is used, and the value of a number field is stated as a decimal number that is not surrounded with double quotations.
    • Before: An error occurs depending on the number of digits after the decimal point.
    • After: No error will occur.

Error message changes

  • Error message shown when the Bulk Request API is run in parallel:
    • Before: "Illegal request."
    • After: "Failed to update the record. Data is now being imported from an Excel or a CSV file. Wait a while and try again."
  • Error message shown when a required parameter is omitted and an error is responded as an array:
    • Before: "It cannot be null."
    • After: "It is required."

Kintone JavaScript API

New features

  • Feature to retrieve the object of a changed field or a changed table row during the "When a Field Value Changes" event.
    A changed field will return an object containing the field type and value of the field. A changed table row will return an object containing the field type and values of all the fields in the table row.
    • Record List Event: When a Field Value Changes
    • Record Create Event: When a Field Value Changes
    • Record Edit Event: When a Field Value Changes
  • Feature for attachments to be uploaded by kintone.proxy()
    Binary file can be uploaded.
    • kintone.proxy.upload()
    • kintone.plugin.app.proxy.upload()
  • Feature to cancel the Before Deleting a Record event.
    The app.record.{detail|index}.delete.submit event can be canceled by returning the event object containing particular values.
    • Record List Event: Before Deleting a Record
    • Record Details Event: Before Deleting a Record

Bug fixes

  • When selectable field types such as User selection, Department selection, and Group selection are inside a Field group field and an event handler is also set, the list view does not display correctly.
    This bug occurs when the Field group is opened and exposes the selectable fields.
  • The Show/Hide Fields API (kintone.app.record.setFieldShown) affects the Related Records field.
    This bug occurs when the Datasource App of the Related Records field targets the app it belongs to, and the Show/Hide Fields API is used.
  • Get Record Field Element API (kintone.app.record.getFieldElement ) retrieved the field element in Related Records.
    This bug occurs when the Datasource App of the Related Records field targets the app it belongs to and the Get Record Field Element API targets a field in the Related Records.