node v6.17.1
version: 1.1.0
// Create Circuit client instance for OAuth 2.0 (Client Credentials Grant) on the sandbox system const Circuit = require('circuit-sdk') const client = new Circuit.Client({ client_id: 'b1376280114c4062b7be44eb00bba048', client_secret: '6dc45749dc034b09b451229bc9aa5f97', domain: '' }); // Register and log all events Circuit.supportedEvents.forEach(e => client.addEventListener(e, console.log)); // Logon, then create a group conversation with two users and send a text message client.logon() .then(user => console.log(`Logged on as ${user.displayName}`, user)) .then(() => client.getUsersByEmail(['', ''])) .then(users => => user.userId)) .then(userIds => client.createGroupConversation(userIds, 'Runkit demo')) .then(conv => client.addTextItem(conv.convId, 'I am test bot. What can I do for you?')) .catch(console.error)

no comments

    sign in to comment