0.0
No commit activity in last 3 years
No release in over 3 years
The Ruby gem for the Creatary REST APIs
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.9.0
~> 0.6.1
= 0.9.2
= 1.3.2
~> 0.5.0
~> 1.7.0

Runtime

~> 1.5
~> 0.4.3
~> 1.2.1
 Project Readme

The Creatary Ruby gem

A Ruby wrapper for the Creatary REST APIs

Installation

gem install creatary-sdk

Documentation

https://creatary.com

How to Use

If you are using rails then:

  1. Add the creatary-sdk gem to your Gemfile
	gem 'creatary-sdk'
  1. Create a creatary.yml file in config with following contents:
	development: &defaults
		consumer_key:     # the consumer key generated in creatary.com for you application
		consumer_secret:  # the consumer secret generated in creatary.com for you application
		consumer_handler: # the of the class that implements the creatary handler logic
	test:
		<<: *defaults
	production:
		<<: *defaults
  1. Add following route to your routes.rb
	match '/creatary/(:string)' => Creatary::API 	# you can replace 'creatary' with any other namespace
  1. Implement the Creatary handler logic (e.g.: creatary_handler.rb in helpers)
	class CreataryHandler
	  def authorized(user, session)
		# should return the URL to which Creatary should redirect
	  end

	  def denied(session)
		# should return the URL to which Creatary should redirect
	  end
	
	  def receive_sms(from_user, to_app, body)
	  end
	
	  def lifecycle_notification(channel, invoker, reason, application_name, notification_type, access_tokens)
	  end
	  
	end
  1. The routes exposed by the gem in your rails application are:
	/creatary/authorize           # redirect to this one when you want to initiate the OAUTH authorization flow (pass ?subscription_tariff_name='' parameter to the redirect when performing subscription authorization OAUTH flow)
	/creatary/receive_sms		  # use this one (complement to form absolute path) as SMS URL when registering your application in creatary.com
	/creatary/oauth_callback      # use this one (complement to form absolute path) as OAUTH callback URL when registering your application in creatary.com
	/creatary/lifecycle_callback  # use this one (complement to form absolute path) as subscriber lifecycle callback URL when registering your application in creatary.com

Copyright 2012 Nokia Siemens Networks