0.0
No release in over 3 years
Low commit activity in last 3 years
CLX rest API integration
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
>= 0
~> 10.0
~> 3.0
~> 3.3
 Project Readme

CLXRestAPI

Made for creating easy integration with the CLX Rest API. You can find their API documentation here.

Installation

Add this line to your application's Gemfile:

gem 'clx_rest_api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install clx_rest_api

Configuration

To use the API you need a service plan id and a token. Use the configuration block to set these.

CLXRestAPI.configure do |config|
  config.service_plan_id = "my_service_plan_id"
  config.api_token = "my_api_token"
end

Usage

To use the API create an instance of the CLXRestAPI::Client class. You can send a request to an endpoint like this:

client = CLXRestAPI::Client.new
client.send_batch_message(params: {})

This returns a CLXRestAPI::Response instance.

# Contains the response body parsed from JSON
response.body

# Contains a Net::HTTP response for further debugging
response.original_response

Available endpoints

As of now these are the available endpoints:

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rspec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

To define a new endpoint for the client you can use the provided DSL:

define_endpoint :my_endpoint, :get, "/my_url/:my_param/

:my_param will be fetched from the arguments provided when doing the method call.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/standout/clx_rest_api.

License

The gem is available as open source under the terms of the MIT License.