0.0
No commit activity in last 3 years
No release in over 3 years
UnificationEngine Ruby SDK as a wrapper over UnificationEngine API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0
~> 2.0.1
~> 3.12

Runtime

 Project Readme

ue-ruby-sdk

A UnificationEngine client SDK for Ruby/Rails

Installation

$ gem install ue-ruby-sdk

Usage

app = UEApp.new("APP_KEY","APP_SECRET");

Creating User

#Creating a new user
user = app.create_user

#Using existing user using key and secret
user = UEUser.new "USER_KEY","USER_SECRET"

#Using existing user using it's uri
user = UEUser.new "user://USER_KEY:USER_SECRET@"

Listing Users

users = app.list_users
#users is an array of User objects

Deleting User

user = app.create_user
app.delete_user(user) #true

Adding a connection to a user

connection = user.add_connection "myconnectionname", "facebook", "facebook_access_token"
#connection is an instance of UEConnection
  • connection_name must be unique per connection.
  • access_token has to be valid and working from the provider side

Listing User connections

connections = user.list_connections
# connections is an array of UEConnection objects

Removing a User Connection

user.remove_connection(connection_name) #true | false

Testing a connection

#return true if working, false otherwise
user.test_connection(service_url) #eg: facebook://accesstoken@facebook.com

Sending a message using a connection

require 'ue-ruby-sdk'

app = UEApp.new("UE_APP_ID","UE_APP_SECRET")

options = {
    receivers:[
        {
            name:"Page",
            id:"283031198486599"
        },
        {
            name: "Me"
        }
    ],
    message:{
        subject:"test",
        body: "ABC",
        image:"http://politibits.blogs.tuscaloosanews.com/files/2010/07/sanford_big_dummy_navy_shirt.jpg",
        link:{
            uri: "http://google.com",
            description: "link desc",
            title:"link title"
        }
    }
}



#Create a new user
user = app.create_user


facebook_connection = user.add_connection "fb", "facebook","FACEBOOK_ACCESS_TOKEN"
#                                          |         |
# Connection Name  ------------------------+         |
# Connector Scheme  ---------------------------------+




facebook_connection.send_message options