{"id":19715778,"url":"https://github.com/davidesantangelo/apiwha","last_synced_at":"2025-04-29T20:30:40.534Z","repository":{"id":56842491,"uuid":"175177416","full_name":"davidesantangelo/apiwha","owner":"davidesantangelo","description":"A tiny ruby wrapper around apiwha whatsapp API (https://apiwha.com)","archived":false,"fork":false,"pushed_at":"2020-07-28T04:25:02.000Z","size":28,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-21T03:44:35.397Z","etag":null,"topics":["gem","ruby","whatsapp-api"],"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/davidesantangelo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-12T09:27:46.000Z","updated_at":"2019-05-16T08:09:32.000Z","dependencies_parsed_at":"2022-08-29T06:50:50.094Z","dependency_job_id":null,"html_url":"https://github.com/davidesantangelo/apiwha","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/davidesantangelo%2Fapiwha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidesantangelo%2Fapiwha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidesantangelo%2Fapiwha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidesantangelo%2Fapiwha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidesantangelo","download_url":"https://codeload.github.com/davidesantangelo/apiwha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251578259,"owners_count":21612002,"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":["gem","ruby","whatsapp-api"],"created_at":"2024-11-11T22:39:21.951Z","updated_at":"2025-04-29T20:30:40.283Z","avatar_url":"https://github.com/davidesantangelo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apiwha\n\nA tiny ruby wrapper around ApiWha API. If you want know more visit http://www.apiwha.com website.\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'apiwha'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install apiwha\n\n## Usage\n\n```ruby\nrequire 'apiwha'\n\napiwha = Apiwha.new('Your secret API key')\n\n```\nYour secret API key. You can generate it in your dashboard from https://panel.apiwha.com/\n\n## Pull Messages\n\nAllows you to pull the messages you received and sent.\n\n### Options\n\n```ruby\n  options = {\n    number: nil,\n    type: nil, \n    markaspulled: \"0\", \n    getnotpulledonly: \"0\", \n    limit: 100, \n    orderdesc: \"1\"\n  }\n```\n\n\u003cb\u003enumber:\u003c/b\u003e  (Optional). Get IN or OUT messsages to or from this number.\n\n\u003cb\u003etype:\u003c/b\u003e (Optional). Type of message to retrieve. Possible values: IN or OUT.\n\n\u003cb\u003emarkaspulled:\u003c/b\u003e  (Optional). If you set this value in 1 you will mark your results as pulled.\n\n\u003cb\u003egetnotpulledonly:\u003c/b\u003e  (Optional). If you set this value in 1 you will retrieve only results that you don't have marked as pulled. \n\n\u003cb\u003elimit:\u003c/b\u003e  (Default 100).\n\n\u003cb\u003eorderdesc:\u003c/b\u003e  (Default most recent). If you set this value in 0 you will retrieve result from oldest to newest.\n\n```ruby\nmessages = apiwha.pull_messages(params: options)\n```\n\n``` ruby\nmessages = apiwha.pull_messages(params: { limit: 2 })\n```\n\n```\n[\n    { \n      \"id\":\"14409287\",\n      \"number\":\"391112223456\",\n      \"from\":\"391112223456\",\n      \"to\":\"39886677822\",\n      \"type\":\"IN\",\n      \"text\":\"test hello message\",\n      \"creation_date\":\"2019-03-11 14:29:51\",\n      \"process_date\":\"2019-03-11 14:29:51\",\n      \"failed_date\":null,\n      \"custom_data\":null\n    },\n    \n    { \n      \"id\":\"14409219\",\n      \"number\":\"393938491113\",\n      \"from\":\"393891986619\",\n      \"to\":\"393938491113\",\n      \"type\":\"IN\",\n      \"text\":\"test message\",\n      \"creation_date\":\"2019-03-11 14:28:53\",\n      \"process_date\":\"2019-03-11 14:28:53\",\n      \"failed_date\":null,\n      \"custom_data\":null\n    }\n]\n\n```\n\n\n## Send Message\n\nAllows you to send messages to any destination that wrote to you. \n\n\u003cb\u003enumber:\u003c/b\u003e Destination number. Enter the number with country code. You can check the number formatting in https://faq.whatsapp.com/en/general/21016748\n\n\u003cb\u003etext:\u003c/b\u003e Text of message to send or URL of media to send.\n\n\u003ci\u003eIf this text is an URL that begins with \"http\" and finishes with \".png\" or \".jpg\" the system will send a picture.\u003c/i\u003e\n\n\u003ci\u003eIf this text is an URL that begins with \"http\" and finishes with \".ogg\" the system will send an audio.\u003c/i\u003e\n\n\u003ci\u003eIf this text is an URL that begins with \"http\" and finishes with \".pdf\" the system will send the pdf document.\u003c/i\u003e\n\n\u003cb\u003ecustom_data:\u003c/b\u003e You can add your custom data in each message that you send. Then, you will receive this custom data by webhook events.\n\n\n```ruby\napiwha.send_message(options)\n\n```\n\n## Get Credit\n\nAllows you to query about your credit\n\n```ruby\ncredit = apiwha.get_credit\n\n```\n\n```\n{\n  \"credit\":45\n}\n\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` 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/[USERNAME]/apiwha. 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\n## Code of Conduct\n\nEveryone interacting in the Apiwha project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/apiwha/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidesantangelo%2Fapiwha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidesantangelo%2Fapiwha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidesantangelo%2Fapiwha/lists"}