Slide 28
Slide 28 text
28
Kintone REST API Request – Example in Kintone JavaScript Event
kintone.events.on('app.record.index.show', function(event) {
kintone.api(kintone.api.url('/k/v1/records', true), 'GET', {
app: kintone.app.getId()
}, function(response){
console.log(response);
}, function(error){
console.log(error);
});
return event;
});
kintone.events.on('app.record.index.show', function(event) {
return kintone.api(kintone.api.url('/k/v1/records', true), 'GET', {
app: kintone.app.getId()
}).then(function(response){
console.log(response);
return event;
}).catch(function(error){
console.log(error);
return event;
});
});
Asynchronous operation with simple callback
Asynchronous operation with Promise
https://kintone.dev/en/docs/kintone/js-api/other/kintone-rest-api-request/#kintone-rest-api-request