Skip to content

bdhwan/kintone-node-vx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node-kintone

A Node.js wrapper for kintone API. from original kintone sdk (https://github.com/ueokande/node-kintone) added upload, download file function

Installation

Install via npm

npm install kintone-vx --save

Usage

The following example fetches the information of an app by API token:

var kintone = require('kintone-vx');

var token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
var api = new kintone('example.cybozu.com', { token: token });
api.app.get({ id: 1 }, function(err, response) {
    console.log(response);
});

Authorization by username and password is also allowed:

var api = new kintone('example.cybozu.com', {
    authorization: {
      username: "XXXXXXXX",
      password: "XXXXXXXX"
    }
});

Authorization with basic authentication:

var api = new kintone('example.cybozu.com', {
    authorization: {
      username: "XXXXXXXX",
      password: "XXXXXXXX"
    },
    basic: {
      username: "YYYYYYYY",
      password: "YYYYYYYY",
    }
});

Upload file

api.file.post(filePath, function(fileErr, fileRes) {
    if (fileErr) {
      //error upload file                
    } else {
       var fileKey = fileRes.fileKey;
      //complete upload file
    }
});

Donwload file

api.file.get(fileKey, savePath, function(err, result) {
    if (err) {
      //error download file                
    } else {
      //complete download file
    }
});

API Documentation

LICENSE

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published