Bulk Request
The Bulk Request API allows multiple API requests to run on multiple kintone apps. The below API can be used with the Bulk Request API:
- Add Record
- Add Records
- Update Record
- Update Records
- Delete Records
- Update Status
- Update Statuses
- Update Assignees
Constructor
Parameter
Name | Type | Required | Description |
---|---|---|---|
connection | Connection | yes | The connection module of this SDK. |
Sample code
Init bulk request module
Source code
const kintone = require('kintone-nodejs-sdk');
let kintoneBulkRequest = new kintone.BulkRequest(connection);
Methods
All below methods (excluded
execute()
method) will add request to queue, you must execute theexecute()
function to get result of BulkRequest.
addRecord(appID, recordData)
Parameter
See at Record - addRecord
Return
addRecords(appID, recordsData)
Parameter
See at Record - addRecords
Return
updateRecordById(appID, recordID, recordData, revision)
Parameter
See at Record - updateRecordById
Return
updateRecordByUpdateKey(appID, updateKey, recordData, revision)
Parameter
See at Record - updateRecordByUpdateKey
Return
updateRecords(appID, recordsData)
Parameter
See at Record - updateRecords
Return
deleteRecords(appID, recordIDs)
Parameter
See at Record - deleteRecords
Return
deleteRecordsWithRevision(appID, idsWithRevision)
Parameter
See at Record - deleteRecordsWithRevision
Return
updateRecordAssignees(appID, recordID, assignees, revision)
Parameter
See at Record - updateRecordAssignees
Return
updateRecordStatus(appID, recordID, actionName, assignee, revision)
Parameter
See at Record - updateRecordStatus
Return
updateRecordsStatus(appID, recordsStatusUpdate)
Parameter
See at Record - updateRecordsStatus
Return
execute()
Execute the bulk request and get data response
Parameter
(none)
Return
[Promise]
Sample code
Execute bulk request
Source code
let responseBulkRequest = kintoneBulkRequest
.addRecord(/*[Args]*/)
.addRecords(/*[Args]*/)
.updateRecords(/*[Args]*/)
.deleteRecords()
.execute();
responseBulkRequest
.then((resp) => {
console.log(resp);
})
.catch((err) => {
// write error to console
console.log(err.get());
// Throw error
err.throw()
});
Reference
- Get Record
on developer network