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 | (optional) | The connection module of this SDK. If initializing in browser environment on kintone, this parameter can be ommited to use session authentication. |
Sample code
Init bulk request module
Javascript
// with connection var kintoneBulkRequest = new kintoneJSSDK.BulkRequest(connection); // without connection, module will use session authentication of kintone var kintoneBulkRequest = new kintoneJSSDK.BulkRequest();
Nodejs
const kintone = require('@kintone/kintone-js-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(app, record)
Parameter
See at Record - addRecord
Return
addRecords(app, records)
Parameter
See at Record - addRecords
Return
updateRecordByID(app, id, record, revision)
Parameter
See at Record - updateRecordByID
Return
updateRecordByUpdateKey(app, updateKey, record, revision)
Parameter
See at Record - updateRecordByUpdateKey
Return
updateRecords(app, records)
Parameter
See at Record - updateRecords
Return
deleteRecords(app, ids)
Parameter
See at Record - deleteRecords
Return
deleteRecordsWithRevision(app, idsWithRevision)
Parameter
See at Record - deleteRecordsWithRevision
Return
updateRecordAssignees(app, record, assignees, revision)
Parameter
See at Record - updateRecordAssignees
Return
updateRecordStatus(app, id, action, assignee, revision)
Parameter
See at Record - updateRecordStatus
Return
updateRecordsStatus(app, records)
Parameter
See at Record - updateRecordsStatus
Return
execute()
Execute the bulk request and get data response
Parameter
(none)
Return
[Promise]
Sample code
Execute bulk request
Javascript
var 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(); });
Nodejs
const 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