{"id":21065097,"url":"https://github.com/mm580486/kave_rest_api","last_synced_at":"2025-05-16T02:33:01.494Z","repository":{"id":56879935,"uuid":"84604475","full_name":"mm580486/kave_rest_api","owner":"mm580486","description":null,"archived":false,"fork":false,"pushed_at":"2019-09-12T12:44:55.000Z","size":374,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-26T00:05:48.869Z","etag":null,"topics":["api","gem","kave","kavenegar","rest-api","ruby","ruby-gem","send-sms","sms"],"latest_commit_sha":null,"homepage":null,"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/mm580486.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":"2017-03-10T22:05:05.000Z","updated_at":"2023-03-05T03:21:55.000Z","dependencies_parsed_at":"2022-08-20T23:40:13.696Z","dependency_job_id":null,"html_url":"https://github.com/mm580486/kave_rest_api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mm580486%2Fkave_rest_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mm580486%2Fkave_rest_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mm580486%2Fkave_rest_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mm580486%2Fkave_rest_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mm580486","download_url":"https://codeload.github.com/mm580486/kave_rest_api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254456246,"owners_count":22074135,"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","gem","kave","kavenegar","rest-api","ruby","ruby-gem","send-sms","sms"],"created_at":"2024-11-19T17:53:37.117Z","updated_at":"2025-05-16T02:33:00.654Z","avatar_url":"https://github.com/mm580486.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KaveRestApi\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'kave_rest_api'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install kave_rest_api\n    \n    \n## How do I configure my app for Kave negar service ?\n\n###### Using the generator\n\nRun the generator :\n    ```rails generate kave_rest_api install```\n\nThis will create a initializer at **`config/initializer/kave_rest_api_initializer.rb`**.\nYou can set api key , default sender , strip emoji , debugmode or format\n\n```ruby\nKaveRestApi.configure do |config|\n    \n  # To completely ignore debug mode events(No Errors) uncomment this line *optional\n  # config.debugmode = false #by default it's true\n  \n  # It is recommended that you pull your API keys from environment settings. *required\n  config.api_key = 'XXXX-XXXX-XXXX-XXXX'\n  \n  # Default response format is json (you can use xml too). *optional\n  config.format  = 'json'\n  \n  #If you don't set your sender number in your request, this is the default number used instead *required\n  config.default_sender  = 'XXXXXXXXXXXX'\n  \n  # You can remove problematic emojis (like android emojis) and replace with standard emojis listed here:(https://www.webpagefx.com/tools/emoji-cheat-sheet/)\n  # config.strip_emoji = 'false' # can include false , true and matcher\n  \nend\n```\n\n## Send Simple SMS\n\n\u003cdetails\u003e\n\u003csummary\u003esample (click me)\u003c/summary\u003e\n\n```ruby\nclient=KaveRestApi::SendSimple.new({\n        receptor: '09127105568', # can be array ['09127105568','09123456789'] \u003c = 3000 \n        message: 'hello my freinds'\n        #optional arguments\n        # ,sender: 'XXXXXXXXX'\n        # ,date: (Date.today + 90)\n        # ,type: 0 read this table http://kavenegar.com/rest.html#result-msgmode\n        # ,localid: SomeModel.id\n})\n\nif client.valid?\n    response = client.call\nelse\n    flash[:error]=client.errors.full_messages # is array\n    .\n    .\nend\n\nif response.valid?\n    # anything ....\nelse\n    response.full_message_errors # is string \nend\n\n```\n\u003c/details\u003e\n\nnotice: you can use persian and arabic number in receptor.\n\n## Receive SMS\n\u003cdetails\u003e\n\u003csummary\u003esample (click me)\u003c/summary\u003e\n\n```ruby\nclient= KaveRestApi::Receive.new({\n    #optional arguments\n    linenumber: 'XXXX-XXXX-XXXX-XXXX',\n    isread: 0 # unread sms = 0 and read sms = 1\n})\n\nif client.valid?\n    response = client.call\nelse\n    flash[:error]=client.errors.full_messages # is array\n    .\n    .\nend\n\nif response.valid?\n    inbox=response.entries\nelse\n    response.full_message_errors # is string \nend\n\ninbox = \u003e [\n        {\n            \"messageid\" : 35850015 , \n            \"message\" : \"خدمات پیام کوتاه کاوه نگار\" , \n            \"sender\" : \"09360462960\" ,\n            \"receptor\" : \"3000202030\" ,\n            \"date\" : 1357206241 \n        },\n        {\n            \"messageid\" : 35850016 , \n            \"message\" : \"خدمات پیام کوتاه کاوه نگار\" , \n            \"sender\" : \"09123832441\" ,\n            \"receptor\" : \"3000202030\" ,\n            \"date\" : 1357103281 \n        }\n    ]\n\n\n\n```\n\u003c/details\u003e\n\n## Lookup\n\n\u003cdetails\u003e\n\u003csummary\u003esample (click me)\u003c/summary\u003e\n\n```ruby\nclient=KaveRestApi::Lookup.new({\n    receptor: 'XXXXXXXXX',\n    token: '4334', # only standard digit and english chars\n    template: 'auth',\n    #optional arguments\n    type: 'sms' # or call\n    token2: 'blah blah',\n    token3: 'blah blah'\n})\n\n\nif client.valid?\n    response = client.call\nelse\n    flash[:error]=client.errors.full_messages # is array\n    .\n    .\nend\n\nif response.valid?\n    # succecful\nelse\n    #error \nend\n\n\n```\n\u003c/details\u003e\n\n\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmm580486%2Fkave_rest_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmm580486%2Fkave_rest_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmm580486%2Fkave_rest_api/lists"}