Skip to content
A Ruby gem for communicating with the BSG API
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
LICENSE
README.md
bsg_client.gemspec

README.md

Requirements

  • Sign up for a free BSG account
  • Create a new access_key (live or test access key)

Examples

First, you need to create an instance of BSG::Client. Be sure to replace YOUR_ACCESS_KEY with something real in the bottom example.

require 'pp'              # Only needed for this example
client = BSG::Client.new(YOUR_ACCESS_KEY)

That's easy enough. Now we can query the server for information.

Messages

Chances are that the most common use you'll have for this API client is the ability to send out text messages. For that purpose we have created the message_create method, which takes the required originator, one or more msisdn and a body text for parameters.

pp client.message_create(destination: 'phone', originator: 'SENDER', body: 'message text', msisdn: '380662341945', reference: 'MyReference')

#<BSG::MESSAGE:0x007faad71306f8
 @error=0,
 @id="172",
 @price="0.2300000",
 @currency="EUR">
You can’t perform that action at this time.