The telco asset marketplace Ruby gem

A Ruby wrapper for the Telco Asset Marketplace REST APIs

Installation

gem install tam

Documentation

https://code.telcoassetmarketplace.com

How to Use

If you are using rails then:

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

      def denied(session)
        # should return the URL to which telcoassermarketplace should redirect
      end

      def receive_sms(from_user, to_app, body)
      end

    end
  1. The routes exposed by the gem in your rails application are:
    /tamapi/authorize
    /tamapi/receive_sms     # use this one (complement to form absolute path) as SMS URL when registering your application in telcoassetmarketplace.com
    /tamapi/oauth_callback  # use this one (complement to form absolute path) as OAUTH callback URL when registering your application in telcoassetmarketplace.com