setyongr / b24 Goto Github PK
View Code? Open in Web Editor NEWBitrix24 Client Library
License: MIT License
Bitrix24 Client Library
License: MIT License
Hello.
https://training.bitrix24.com/rest_help/crm/contacts/crm_contact_list.php
Any example I'm trying to use, I get an error with Parameter 'param' must be array.
bitrix24.callMethod("crm.contact.list", {
order: { "DATE_CREATE": "ASC" },
filter: { "TYPE_ID": "CLIENT" },
select: [ "ID", "NAME", "LAST_NAME", "TYPE_ID", "SOURCE_ID" ]
});
Is there any difference between this library and the library used in the documentation examples?
when I implement this library, the project displays this error Unable to resolve module 'querystring'. from '/../../node_modules/b24/dist/index.js'
. please resolve this error
When we send a find method, the "querystring" native package can't handle nasted objects.
I'll send a pull request with a new "qs" package installation dependency to correct it.
Dont forget to add License โ๏ธ
Hi baws,
I have tried everything i can but can't get to call the methods from inside my libray, kindly have a look
const express = require('express');
const b24 = require('b24');
const app = express();
var ethers = require('ethers');
// Connect to the network
var providers = require('ethers').providers;
var network = providers.networks.ropsten;
// Connect to a local Parity instance
var provider = new providers.JsonRpcProvider('http://localhost:8545', network);
const bitrix24 = new b24.Bitrix24({
config: {
mode: "api",
host: "xxxxxxxxx",
client_id : "local.cccccccccccccccccccccccccc",
client_secret : "dddddddddddddddddddddddddddd",
redirect_uri : "http://localhost:3000/callback"
},
methods: {
async saveToken(data){
//Save token to database
},
async retriveToken(){
//Retrive token from database
return {
access_token: "youraccesstoken",
refresh_token: "yourrefreshtoken"
}
}
}
})
// Get notified when a contract event is logged
var eventTopic = '0xf538d33cf0aeab2f474d1ec307854fed7e411946cb8e4239785e4f7d2c424047';
provider.on([ eventTopic ], function(log) {
console.log('Event Log');
console.log(log);
var Call = log;
// Bitrix auth
app.get('/auth', (req, res) => {
res.redirect(bitrix24.auth.authorization_uri);
});
// Callback service parsing the authorization token and asking for the access token
app.get('/callback', async (req, res) => {
try{
const code = req.query.code;
const result = await bitrix24.auth.getToken(code);
return res.json(result);
}catch(err){
console.log(err)
return res.status(500).json({message:"Authentication Failed"});
}
});
// if (Call == "xxxxxxx") {
app.get('/allUser', async (req, res) => {
try{
const result = await bitrix24.callMethod('user.add', {"EMAIL": "[email protected]"});
return res.json(result);
}catch(err){
console.log(err)
return res.status(222).json({"result":222});
}
});
});
app.listen(3000, () => {
console.log('Server started on port 3000');
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.