{"id":17600209,"url":"https://github.com/jage/elk","last_synced_at":"2025-07-03T07:34:00.479Z","repository":{"id":62557852,"uuid":"2008346","full_name":"jage/elk","owner":"jage","description":":telephone: Ruby API client for 46elks messaging service","archived":false,"fork":false,"pushed_at":"2019-05-31T16:46:30.000Z","size":119,"stargazers_count":18,"open_issues_count":2,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-31T08:57:53.235Z","etag":null,"topics":["api-client","elk","messaging","ruby","sms"],"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/jage.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-07-06T19:14:27.000Z","updated_at":"2020-09-12T06:36:03.000Z","dependencies_parsed_at":"2022-11-03T06:30:46.847Z","dependency_job_id":null,"html_url":"https://github.com/jage/elk","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/jage/elk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jage%2Felk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jage%2Felk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jage%2Felk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jage%2Felk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jage","download_url":"https://codeload.github.com/jage/elk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jage%2Felk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262879720,"owners_count":23378664,"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":["api-client","elk","messaging","ruby","sms"],"created_at":"2024-10-22T11:09:47.195Z","updated_at":"2025-07-03T07:34:00.454Z","avatar_url":"https://github.com/jage.png","language":"Ruby","readme":"# Elk - 46elks API-client\n\n[![Build Status](https://travis-ci.org/jage/elk.svg?branch=master)](https://travis-ci.org/jage/elk)\n[![Code Climate](https://codeclimate.com/github/jage/elk/badges/gpa.svg)](https://codeclimate.com/github/jage/elk)\n\nRuby client for 46elks \"Voice, SMS \u0026 MMS\" service. https://www.46elks.com/\nAt the moment the API only supports sending SMS messages.\n\n## Requirements\n\n* Modern Ruby: \u003e= 2.4\n* API account at 46elks.com\n\n## Install\n\nInstall via RubyGems\n\n    gem install elk\n\n## Source and development\n\nThe source for Elk is available on Github:\n\n    https://github.com/jage/elk\n\nElk uses rspec and webmock for testing, do a `bundle install` for all the development requirements.\n\nTest specs with:\n\n    bundle exec rake spec\n\n## Usage\n\nelk can be used to allocate phone numbers, manage the numbers and send/receive messages through these numbers.\n\n### Authentication and configuration\n\nFirst thing when using elk is to set the authentication parameters\n\n```Ruby\nrequire \"elk\"\n\nElk.configure do |config|\n  config.username = \"USERNAME\"\n  config.password = \"PASSWORD\"\nend\n```\n\nIt is possible to avoid the singleton configuration:\n\n```Ruby\nrequire \"elk\"\n\nclient = Elk::Client.new\nclient.configure do |config|\n  config.username = \"USERNAME\"\n  config.password = \"PASSWORD\"\nend\n\n# Then pass client to the class methods\nnumbers = Elk::Number.all(client: client)\n# =\u003e [#\u003cElk::Number ...\u003e, #\u003cElk::Number ...\u003e]\n\n\nElk::SMS.send(client: client, from: \"MyService\", to: \"+46704508449\", message: \"Your order #171 has now been sent!\")\n# =\u003e #\u003cElk::SMS:0x0000010179d7e8 @client=... @from=\"MyService\", @to=\"+46704508449\", @message=\"Your order #171 has now been sent!\", @message_id=\"sdc39a7926d37159b6985283e32f43251\", @created_at=2011-07-17 16:21:13 +0200, @loaded_at=2011-07-17 16:21:13 +0200\u003e\n```\n\n### Numbers\n\nTo be able to send and recieve messages, a number is needed. Several numbers can be allocated.\n\n```Ruby\nnumber = Elk::Number.allocate(sms_url: \"http://myservice.se/callback/newsms.php\", country: \"se\")\n# =\u003e #\u003cElk::Number:0x0000010282aa70 @country=\"se\", @sms_url=\"http://myservice.se/callback/newsms.php\", @status=\"yes\", @number_id=\"n03e7db70cc06c1ff85e09a2b3f86dd62\", @number=\"+46766861034\", @capabilities=[:sms], @loaded_at=2011-07-17 15:23:55 +0200\u003e\n```\n\nGet all numbers\n\n```Ruby\nnumbers = Elk::Number.all\n# =\u003e [#\u003cElk::Number ...\u003e, #\u003cElk::Number ...\u003e]\n```\n\nChange number settings\n\n```Ruby\nnumber.sms_url = \"http://myservice.se/callback/newsms.php\"\nnumber.save\n# =\u003e true\n```\n\nDeallocate a number.\nBeware that there is no way to get your number back once it has been deallocated!\n\n```Ruby\nnumber.deallocate!\n# =\u003e true\nnumber.status\n# =\u003e :deallocated\n```\n\n### SMS\n\nSend SMS. Messages can be sent from one of the allocated numbers or an arbitrary alphanumeric string of at most 11 characters.\n\n```Ruby\nElk::SMS.send(from: \"MyService\", to: \"+46704508449\", message: \"Your order #171 has now been sent!\")\n# =\u003e #\u003cElk::SMS:0x0000010179d7e8 @from=\"MyService\", @to=\"+46704508449\", @message=\"Your order #171 has now been sent!\", @message_id=\"sdc39a7926d37159b6985283e32f43251\", @created_at=2011-07-17 16:21:13 +0200, @loaded_at=2011-07-17 16:21:13 +0200\u003e\n```\n\nReceiving SMS does not require Elk, but should be of interest anyway.\nExample with Sinatra:\n\n```Ruby\npost \"/receive\" do\n  if request.params[\"message\"] == \"Hello\"\n    # Sends a return SMS with message \"world!\"\n    \"world!\"\n  end\nend\n```\n\nSMS history\n\n```Ruby\nElk::SMS.all\n# =\u003e [#\u003cElk::SMS ...\u003e, #\u003cElk::SMS ...\u003e, \u003cElk::SMS ...\u003e]\n```\n\n## Copyright\n\nCopyright (c) 2011 Johan Eckerström. See [MIT-LICENSE](MIT-LICENSE) for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjage%2Felk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjage%2Felk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjage%2Felk/lists"}