Node JS SDKのサンプルコード - 組織とユーザーの操作
var crmclient = require('zcrmsdk');
crmclient.initialize();
var params = {};
crmclient.API.ORG.get(params).then(function(response) {
// Response of the API call is returned in the 'body'
// The organization details are obtained from the first JSON object of the JSON Array corresponding
// to the 'org' key of the response
response = JSON.parse(response.body).org;
response = response[0];
// For obtaining all the fields of the organization details, use the value of 'response' as such
console.log(response);
// For obtaining a particular field, use response.<api-name of field>
// Sample API names: country, city
console.log(response.country);
});
//GET A PARTICULAR USER DATA
var crmclient = require('zcrmsdk');
crmclient.initialize();
input = {};
input.id = '3519112000000177021'; // id: user-id
crmclient.API.USERS.get(input).then(function(response) {
// Response of the API call is returned in the 'body'
// The user details are obtained from the first JSON object of the JSON Array corresponding
// to the 'users' key of the response
response = JSON.parse(response.body);
response = response.users[0];
// For obtaining all the fields of the user details, use the value of 'response' as such
console.log(response);
// For obtaining a particular field, use response.<api-name of field>
// Sample API names: state, email
console.log(response.language);
});