{"id":15288829,"url":"https://github.com/raicg/wassenger_client","last_synced_at":"2025-04-13T08:11:27.147Z","repository":{"id":56897794,"uuid":"217115016","full_name":"raicg/wassenger_client","owner":"raicg","description":"The gem wassenger_client is a ruby client for wassenger.com API","archived":false,"fork":false,"pushed_at":"2022-10-07T16:39:24.000Z","size":52,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T08:07:56.604Z","etag":null,"topics":["begginers","hacktoberfest","ruby","ruby-gem","ruby-on-rails"],"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/raicg.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":"2019-10-23T17:27:38.000Z","updated_at":"2023-11-14T17:41:29.000Z","dependencies_parsed_at":"2022-08-21T02:20:15.320Z","dependency_job_id":null,"html_url":"https://github.com/raicg/wassenger_client","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/raicg%2Fwassenger_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raicg%2Fwassenger_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raicg%2Fwassenger_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raicg%2Fwassenger_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raicg","download_url":"https://codeload.github.com/raicg/wassenger_client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248332457,"owners_count":21086075,"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":["begginers","hacktoberfest","ruby","ruby-gem","ruby-on-rails"],"created_at":"2024-09-30T15:53:20.149Z","updated_at":"2025-04-13T08:11:27.115Z","avatar_url":"https://github.com/raicg.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WassengerClient\n\nRuby client for wassenger.com API (https://wassenger.com/)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'wassenger_client'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install wassenger_client\n\n## Usage\n\nFirst of all you need to create the variable ENV['WASSENGER_TOKEN'] with your token.\n\n### Creating Webhooks:\n\n```ruby\nresponse = WassengerClient::Webhook.register(\nname: 'name of the webhook',\nurl: 'your_website_url.com/webhook',\nevents: ['message:in:new']\n)\n```\navailable events: 'message:in:new', 'message:out:sent', 'message:out:failed'\n\n### Sending Messages:\n\n```ruby\nparams = {\n    phone: '+558499887766',\n    message: 'message to send'\n}\n\nwassenger_client_response = WassengerClient::Message.send(params)\n```\nYou can use more params, look at the documentation (https://docs.wassenger.com/#operation/createMessage)\n\n### Receiving Messages or Status of Sent Messages:\n```ruby\nevent = WassengerClient::Event.new(params)\nmessage = event.message\n```\n\nThis code will probably be in a webhook controller and the params will be the parameters received by some request of the wassenger service, you need to create the webhook first.\n\nmessage get many parameters and they may be different because of the different events of the webhook, here are some of them:\n```ruby\ntext = message['message']\nphone_number = message['phone']\nstatus = message['status']\ndelivery_status = message['deliveryStatus']\nretries = message['retries']\nsent_at = message['sentAt']\ndevice_id = message['device']\nwebhook_status = message['webhookStatus']\nreference = message['reference']\nwassenger_message_id = message['id']\nwhatsapp_id = message['waId']\nuser = message['user']\ngoogle_account = message['googleAccount']\nmessage_type = message['type']\nfrom_phone_number = message['fromNumber']\nreceived_at  = message['date']\n```\n\nYou can use the methods below to check what is the event, this may be useful if you create a webhook with more then one event.\n\n```ruby\nevent = WassengerClient::Event.new(params)\nevent.in_new? # returns true if the event is 'message:in:new'\nevent.sent_message? # returns true if the event is 'message:out:sent'\nevent.failed_message? # returns true if the event is 'message:out:failed'\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/raicg/wassenger_client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\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%2Fraicg%2Fwassenger_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraicg%2Fwassenger_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraicg%2Fwassenger_client/lists"}