unificationengine-client
A UnificationEngine client SDK for NodeJS
Here's how simple it is to post a message on your wall and a Facebook page, in a single call:
connection.sendMessage({
"receivers":[
{"name":"me"},
{"name":"Page", "id":"122"}
],
"message":{"body": "Hello World!"}
});
Installation
$ npm install --save ue-node-sdk
Usage
var UEClient = require('ue-node-sdk');
var app = new UEClient("APP_KEY","APP_SECRET");
Creating User
app.createUser()
.then(function(user){
})
.catch(function(err){
});
Listing Users
app.listUsers()
.then(function(users){
})
.catch(function(err){
});
Deleting User
app.deleteUser(user)
.then(function(){
})
.catch(function(err){
});
Adding a connection to a user
user.addConnection(connectionName, service, serviceAccessToken, optionalParams)
.then(function(connection){
})
.catch(function(err){
});
connectionName
must be unique per connection.
serviceAccessToken
has to be valid and working from the provider side
optionalParams
an object with key:value pair
Listing User connections
user.listConnections()
.then(function(connections){
})
.catch(function(err){
});
Removing a User Connection
user.removeConnection(connectionName)
.then(function(){
})
.catch(function(err){
});
Testing a connection
user.testConnection(serviceUrl)
.then(function(){
})
.catch(function(err){
});
Sending a message using a connection
connection.sendMessage({
"receivers":[
{
"name":"me"
},
{
"name":"Page",
"id":"122"
}
],
"message":{
"subject":"test",
"body": "ABC",
"image":"http://imageUrl",
"link":{
"uri": "http://google.com",
"description": "link desc",
"title":"link title"
}
}
})
.then(function(uris){
console.log(uris);
})
.catch(function(err){
});