Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require('dotenv').config();
- const kintone = require('kintone-nodejs-sdk');
- const env = process.env;
- // Define Authentication object
- let kintoneAuth = new kintone.Auth();
- let username = env.USER_NAME;
- let password = env.PASSWORD;
- kintoneAuth.setPasswordAuth(username, password);
- let DomainName = env.DOMAIN;
- let kintoneConnection = new kintone.Connection(DomainName, kintoneAuth);
- let kintoneApp = new kintone.App(kintoneConnection);
- function fetchApps(optOffset, optLimit) {
- let offset = optOffset || 0;
- let limit = optLimit || 100;
- kintoneApp.getApps(offset, limit)
- .then((rsp) => {
- let apps = rsp.apps;
- if (apps.length === 100) {
- console.log(apps);
- return fetchApps(offset + 100, limit);
- }
- console.log(apps);
- })
- .catch((err) => {
- // This SDK return err with KintoneAPIExeption
- console.log(err.get());
- });
- }
- fetchApps();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement