{"id":14955939,"url":"https://github.com/bayevels/orange-sms-ruby","last_synced_at":"2025-07-19T23:36:25.056Z","repository":{"id":45220961,"uuid":"288182864","full_name":"bayevels/orange-sms-ruby","owner":"bayevels","description":"Orange Sms Ruby is a client library that allow you to send sms from a RoR app using the Orange Sms API https://developer.orange.com/apis/sms-sn/overview","archived":false,"fork":false,"pushed_at":"2021-12-30T12:44:29.000Z","size":22980,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-20T05:52:12.729Z","etag":null,"topics":["orange","orange-sms-api","rails","ruby","sms","sms-client"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bayevels.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-17T13:07:41.000Z","updated_at":"2024-05-29T23:12:15.000Z","dependencies_parsed_at":"2022-07-19T00:32:16.340Z","dependency_job_id":null,"html_url":"https://github.com/bayevels/orange-sms-ruby","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/bayevels/orange-sms-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayevels%2Forange-sms-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayevels%2Forange-sms-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayevels%2Forange-sms-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayevels%2Forange-sms-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bayevels","download_url":"https://codeload.github.com/bayevels/orange-sms-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayevels%2Forange-sms-ruby/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266042009,"owners_count":23867960,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["orange","orange-sms-api","rails","ruby","sms","sms-client"],"created_at":"2024-09-24T13:12:03.192Z","updated_at":"2025-07-19T23:36:25.039Z","avatar_url":"https://github.com/bayevels.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OrangeSms\n[![Gem Version](https://badge.fury.io/rb/orange_sms.svg)](https://badge.fury.io/rb/orange_sms)\n![Build Status](https://travis-ci.com/bayevels/orange-sms-ruby.svg?branch=master)\n[![Coverage](https://bayevels.github.io/orange-sms-ruby/badges/coverage_badge_total.svg)](https://bayevels.github.io/orange-sms-ruby/coverage/index.html)\n\u003e Orange Sms Ruby is a client library that allow you to send sms from a RoR app using the [Orange Sms API](https://developer.orange.com/apis/sms-sn/overview)\n\n## Disclaimer\nThis gem is not an official client of Orange, in order to use the client you need to create a [Orange Sms API](https://developer.orange.com/apis/sms-sn/overview) and to register an app in the developer dashboard that orange provide to you. After registering your app you can ask for sms integration approval (this process can take time :)).\nThe registration process is detailed [here](https://developer.orange.com/apis/sms-sn/overview)\n## Motivation\nInstead of reading and trying to understand once again how the Orange Sms API work this gem aims to let you quickly send sms from a ruby  app (mainly RoR) using the [Orange Sms API](https://developer.orange.com/apis/sms-sn/overview).\n\n```ruby\n# default receiver country is Senegal (:sen)\nclient = OrangeSms::Client.new\nclient.send_sms('776879809', 'Simple comme bonjour !')\n# Or specify the country code when sending\nclient = OrangeSms::Client.new(:civ) # Ivory coast code\nclient.send_sms('776879809', 'Simple comme bonjour !')\n```\n## Getting Started\n\n### Setup\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'orange_sms'\n```\nThen run `bundle install`\n\nNext, you need to run the generator:\n\n```ruby\nrails generate orange_sms:install\n```\nThe generator will create an initializer file `/config/initializers/orange_sms.rb`.\nYou can setup, your app information there.\n```ruby\nOrangeSms.setup do |config|\n  # Sender Name\n  # config.sender_name = 'GITHUB'\n  config.sender_name = 'put your coporate name here'\n\n  # Sender Phone\n  config.sender_phone = 'put your phone number here'\n\n  # Sender country code. Follow ISO-3166 alpha 3 country codes. Default country value is :sen (Senegal)\n  # You can find supported countries by Orange Api in the folllowing link https://developer.orange.com/apis/sms-sn/getting-started\n  # config.sender_country_code = :sen\n\n  # Follow ISO-3166 alpha 3 country codes. Default country value is :sen (Senegal)\n  # Use the country code of your receivers. You can find supported countries by Orange Api in the folllowing link https://developer.orange.com/apis/sms-sn/getting-started\n  # config.default_receiver_country_code = :sen\n\n  # Authorization Header you can find the Authorization header in your app dashboard https://developer.orange.com/myapps\n  config.authorization = 'put your Authorization Header here !' \n\n  # Generate the access token with the interactive console\n  # --\u003e client = OrangeSms::Client.new\n  # --\u003e client.fetch_access_token =\u003e 'CeppeLvEUgWK4o0r2WW2IzBrMQEn'\n  config.access_token = 'put your access_token here !'\nend\n```\n### Generate Access token\nin order to fetch the access token you need first to get the Authorization header from your Orange developer dashboard and to add it to your configuration file\n```ruby\nconfig.authorization = 'Basic NktSSHljksdj7P...Jjndb6UdnlrT2lOaA==' \n```\nYou can now get your access token using the rails console. Run in your terminal `rails console` and next\n```ruby\nclient = OrangeSms::Client.new\nclient.fetch_access_token ==\u003e i6m2iIcY0SodWSe...L3ojAXXrH\n```\nCopy it and paste it into your initializer file, and add it to the initializer file `/config/initializers/orange_sms.rb`\n```ruby\nconfig.access_token = 'i6m2iIcY0SodWSe...L3ojAXXrH' # You may use ENV variables\n```\n:warning: The access token will last 7776000 seconds, i.e. 90 days. After this period, you'll get an error and should request another token.\n\n### Test it :sunglasses:\nyou can test the integration in the rails console, open up the console `rails console` next run the code down below\n```ruby\n# default receiver country is Senegal (:sen)\nclient = OrangeSms::Client.new\nclient.send_test_sms # Will send sms to the sender_phone that you have specified inside `/config/initializers/orange_sms.rb`.\n```\n### Send Sms\n```ruby\n# default receiver country is Senegal (:sen)\nclient = OrangeSms::Client.new\nclient.send_sms('776879809', 'Simple comme bonjour !')\n# Or specify the country code when sending\nclient = OrangeSms::Client.new(:civ) # Ivory coast code\nclient.send_sms('776879809', 'Simple comme bonjour !')\n```\n### Handling Errors\n```ruby\nbegin\n  client = OrangeSms::Client.new\n  client.send_sms('776879809', 'Simple comme bonjour !')\nrescue OrangeSms::Error::ApiError =\u003e e\n  puts e.message\nend\n```\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo 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](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/bayevels/orange_sms.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbayevels%2Forange-sms-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbayevels%2Forange-sms-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbayevels%2Forange-sms-ruby/lists"}