Project

cequens

0.0
No release in over a year
A library to interface with Cequens SMS gateway API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 5.0
~> 2.0
~> 6.1
~> 13.0
~> 3.10
~> 1.10
~> 3.11

Runtime

 Project Readme

Cequens

Disclaimer: we are not officially affilated with Cequens company.

A plug-and-play library that make it easier to use Cequens SMS APIs

Installation

Add this line to your application's Gemfile:

gem 'cequens'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cequens

Usage

configure access token as:

$ rails g cequens:config

Cequens.config do |c|
# c.access_token = token # add your access token not api token
# access_token is what you get when you login
# c.sender_name = sender_name
end

Send SMS

params = {
    "messageText": 'Test from Ahmed',
    "senderName": 'Cequens',
    "messageType": 'text',
    "recipients": '2011111111'
  }

res = Cequens.send_sms(params)
#  => #<Cequens::Response:0x00007ffd672b29f8 @api_response={"replyCode"=>0, "replyMessage"=>"Request handled successfully", "requestId"=>"64035880-7044-11eb-9f04-11a5522e89a7", "clientRequestId"=>0, "requestTime"=>"2021-02-16T10:47:40.296", "data"=>{"SentSMSIDs"=>[{"SMSId"=>"056ef72a-1497-47be-a4c8-4a7835e071dc"}], "InvalidRecipients"=>""}}>

res.success? # => true

Get SMS Details

res = Cequens.get_sms_details(id: "AAAAA")
#  => #<Cequens::Response:0x00007ffd672b29f8 @api_response={"replyCode"=>0, "replyMessage"=>"Request handled successfully", "requestId"=>"64035880-7044-11eb-9f04-11a5522e89a7", "clientRequestId"=>0, "requestTime"=>"2021-02-16T10:47:40.296", "data"=>{"SentSMSIDs"=>[{"SMSId"=>"056ef72a-1497-47be-a4c8-4a7835e071dc"}], "InvalidRecipients"=>""}}>

res.success? # => true
res.message # => Request handled successfully