This is an unofficial Ruby client for the Primotexto API.
Add this line to your application's Gemfile:
gem 'primotexto'
Or from Github to install the 'edge' version:
gem 'primotexto', github: 'syntaxTerr0r/primotexto'
And then execute:
$ bundle
Or install it yourself as:
$ gem install primotexto
All API methods are not implemented yet. Here is an exhaustive list of what is currently supported. Methods naming try to follow the API naming, however some changes has been made to make some name more friendly.
pt = Primotexto.client(key: 'MY_SHINY_API_KEY')
Alternatively, you can define the key in an ENV
variable: PRIMOTEXTO_API_KEY
pt = Primotexto.client
message = pt.post_notification_message(number: '+33612345678', sender: 'Spiderman', message: 'Your new code is "W0WE".', category: 'codeConfirmation')
message = pt.post_marketing_message(number: '+33612345678', sender: 'Carwash', message: 'Get 30% off with this coupon: "W4SH" until tomorrow.')
See more about E.164 phone formatting.
By phone number
pt.get_messages_status(identifier: '+33612345678')
Or by snapshotId
pt.get_messages_status(snapshotId: message[:snapshotId])
pt.get_messages_stats(category: 'codeConfirmation')
pt.get_messages_replies(category: 'codeConfirmation')
pt.get_messages_blacklists(category: 'codeConfirmation')
pt.get_unsubscribers_contacts
pt.post_unsubscribers_contacts(identifier: '+33612345678')
pt.delete_unsubscribers_contacts(identifier: '+33612345678')
pt.get_bounces_contacts
pt.post_bounces_contacts(identifier: '+33612345678')
pt.delete_bounces_contacts(identifier: '+33612345678')
vip_list = pt.post_lists(name: 'VIP People')
vip_contact = pt.post_list_contact(list_id: vip_list[:id], identifier: '+33612345678')
pt.delete_list_contact(list_id: vip_list[:id], contact_id: vip_contact[:id], identifier: '+33612345678')
pt.get_account_stats
This gem has no specs yet.
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
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.
Bug reports and pull requests are welcome on GitHub at https://github.com/syntaxTerr0r/primotexto.
The gem is available as open source under the terms of the MIT License.