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 |
---|---|---|---|
params | Object | (optional) | Constructor params. |
params.connection | Connection | yes | The connection module of this SDK. |
Sample code
Init bulk request module
const kintone = require('@kintone/kintone-wechat-miniprogram-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, id, 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
const responseBulkRequest = kintoneBulkRequest .addRecord({/*[Args]*/}) .addRecords({/*[Args]*/}) .updateRecords({/*[Args]*/}) .deleteRecords({/*[Args]*/}) .execute(); responseBulkRequest.then((resp) => { console.log(resp); }).catch((errors) => { // write error to console console.log(errors); errors.forEach((err) => { if (typeof err.get === 'function') { console.log(err.get()); } }); });
Reference
- Get Record
on developer network