{"id":13878397,"url":"https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk","last_synced_at":"2025-05-15T09:08:24.224Z","repository":{"id":38018017,"uuid":"497664862","full_name":"ignacio-chiazzo/ruby_whatsapp_sdk","owner":"ignacio-chiazzo","description":"A lightweight, efficient Ruby gem for interacting with Whatsapp Cloud API.","archived":false,"fork":false,"pushed_at":"2025-04-09T16:19:18.000Z","size":9808,"stargazers_count":173,"open_issues_count":9,"forks_count":40,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-14T15:56:52.896Z","etag":null,"topics":["bot","chat","chatbots","cloud-api","facebook-ruby","facebookapi","hacktoberfest","hacktoberfest-accepted","meta","ruby","ruby-gem","sdk","whatsapp","whatsapp-api","whatsapp-bot","whatsapp-chat","whatsapp-cloud-api-client","whatsapp-web","whatsappbot","whatsappcloudapi"],"latest_commit_sha":null,"homepage":"https://ignacio-chiazzo.github.io/ruby_whatsapp_sdk/","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/ignacio-chiazzo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.MD","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-29T17:43:39.000Z","updated_at":"2025-04-13T15:50:02.000Z","dependencies_parsed_at":"2024-01-08T18:03:37.012Z","dependency_job_id":"8950a6b0-9c47-44a6-b773-f5ac49697fbc","html_url":"https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk","commit_stats":{"total_commits":357,"total_committers":21,"mean_commits":17.0,"dds":"0.22408963585434172","last_synced_commit":"86b3681bba29092ca442577d0443d96c8d59278c"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignacio-chiazzo%2Fruby_whatsapp_sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignacio-chiazzo%2Fruby_whatsapp_sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignacio-chiazzo%2Fruby_whatsapp_sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignacio-chiazzo%2Fruby_whatsapp_sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ignacio-chiazzo","download_url":"https://codeload.github.com/ignacio-chiazzo/ruby_whatsapp_sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254310520,"owners_count":22049470,"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":["bot","chat","chatbots","cloud-api","facebook-ruby","facebookapi","hacktoberfest","hacktoberfest-accepted","meta","ruby","ruby-gem","sdk","whatsapp","whatsapp-api","whatsapp-bot","whatsapp-chat","whatsapp-cloud-api-client","whatsapp-web","whatsappbot","whatsappcloudapi"],"created_at":"2024-08-06T08:01:48.412Z","updated_at":"2025-05-15T09:08:19.216Z","avatar_url":"https://github.com/ignacio-chiazzo.png","language":"Ruby","funding_links":[],"categories":["Ruby","Third-party APIs"],"sub_categories":[],"readme":"# Ruby Whatsapp SDK\n\n[![Gem Version](https://badge.fury.io/rb/whatsapp_sdk.svg)](https://badge.fury.io/rb/whatsapp_sdk)\n[![CircleCI](https://circleci.com/gh/circleci/circleci-docs.svg?style=svg)](https://circleci.com/gh/ignacio-chiazzo/ruby_whatsapp_sdk)\n\u003ca href=\"https://codeclimate.com/github/ignacio-chiazzo/ruby_whatsapp_sdk/maintainability\"\u003e\u003cimg src=\"https://api.codeclimate.com/v1/badges/169cce95450272e4ad7d/maintainability\" /\u003e\u003c/a\u003e\n\nThe SDK provides a set of operations and classes to use the Whatsapp API.\nSend stickers, messages, audio, videos, locations, react and reply to messages or just ask for the phone numbers through this library in a few steps!\n\n## Demo\n\nhttps://user-images.githubusercontent.com/11672878/173238826-6fc0a6f8-d0ee-4eae-8947-7dfd3b8b3446.mov\n\n**Check the [Ruby on Rails Whatsapp example repository](https://github.com/ignacio-chiazzo/ruby_on_rails_whatsapp_example)** that uses this library to send messages.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'whatsapp_sdk'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install whatsapp_sdk\n\n## Quick Start\n\nThere are three primary resources, `Messages`, `Media` and `PhoneNumbers`. `Messages` allows users to send any message (text, audio, location, video, image, etc.). `Media` allows users to manage media, and `Phone Numbers` enable clients to query the associated phone numbers.\n\nTo use `Messages`, `Media` or `PhoneNumbers`, you need to initialize the `Client` that contains auth information. There are two ways to do it.\n\n#### Option 1) Use an initializer\n\n```ruby\n# config/initializers/whatsapp_sdk.rb\nWhatsappSdk.configure do |config|\n  config.access_token = ACCESS_TOKEN\n  config.api_version = API_VERSION\n  config.logger = Logger.new(STDOUT) # optional, Faraday logger to attach\n  config.logger_options = { bodies: true } # optional, they are all valid logger_options for Faraday\nend\n```\n\nNotes:\n- Optionally, you can specify the desired API version to use (defaults to the latest version if omitted).\nAvailable API version can be found [here](https://developers.facebook.com/docs/graph-api/changelog/versions).\n- You can attach a logger. More Details on Faraday Logger Options are [here](https://lostisland.github.io/faraday/#/middleware/included/logging?id=logging).\n\n\n#### Option 2) Create a `Client` instance :\n\n```ruby\n\n# without\nclient = WhatsappSdk::Api::Client.new(\"\u003cACCESS TOKEN\u003e\") # replace this with a valid access token\n\n# OR optionally use a logger, api_version and\nlogger = Logger.new(STDOUT)\nlogger_options = { bodies: true }\nclient = WhatsappSdk::Api::Client.new(\"\u003cACCESS TOKEN\u003e\", \"\u003cAPI VERSION\u003e\", logger, logger_options)\n```\n\n## Set up a Meta app\n\n\u003cdetails\u003e\u003csummary\u003e1) Create a Meta Business app \u003c/summary\u003e\n\u003cimg width=\"1063\" alt=\"Screen Shot 2022-09-05 at 11 03 47 AM\" src=\"https://user-images.githubusercontent.com/11672878/188477795-4745a71a-a4b5-41e2-bef1-e41d3060e02b.png\"\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e2) Add Whatsapp to your Application\u003c/summary\u003e\n\u003cimg width=\"1087\" alt=\"Screen Shot 2022-09-05 at 11 05 43 AM\" src=\"https://user-images.githubusercontent.com/11672878/188478100-98b3bf0a-fec7-4ea1-a492-aeb90a6b06bd.png\"\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e3) Add a phone number to your account\u003c/summary\u003e\n\u003cimg width=\"972\" alt=\"Screen Shot 2022-09-05 at 11 09 22 AM\" src=\"https://user-images.githubusercontent.com/11672878/188478741-8a6105e8-2776-4493-bba9-05a62082a5aa.png\"\u003e\n\u003c/details\u003e\n\nTry sending a message to your phone in the UI.\n\n\u003cdetails\u003e\u003csummary\u003e4) Copy the ACCESS_TOKEN, the SENDER_ID, the BUSINESS_ID and the RECIPIENT_NUMBER\u003c/summary\u003e\n\u003cimg width=\"1010\" alt=\"Screen Shot 2022-09-05 at 11 13 24 AM\" src=\"https://user-images.githubusercontent.com/11672878/188480634-369f8de1-b851-4735-86de-f49e96f78d8c.png\"\u003e\n\u003c/details\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e5) Use the GEM to interact with Whatsapp\u003c/summary\u003e\n\nExample:\n\n1. Install the gem by running `gem install whatsapp_sdk` in the gem.\n2. Open the irb terminal by running `irb`\n3. `require \"whatsapp_sdk\"`\n4. Set up the `ACCESS_TOKEN`, the `SENDER_ID`, the `BUSINESS_ID` and the `RECIPIENT_NUMBER` in variables.\n\n```ruby\nACCESS_TOKEN = \"EAAZAvvr0DZBs0BABRLF8zohP5Epc6pyNu\"\nBUSINESS_ID = 1213141516171819\nSENDER_ID = 1234567891011\nRECIPIENT_NUMBER = 12398765432\n```\n\n5. Configure the Client by running\n\n```ruby\nWhatsappSdk.configure do |config|\n  config.access_token = ACCESS_TOKEN\nend\n```\n\n6. Try the Phone Numbers API or Messages API\n\nPhone Numbers API\n\n```ruby\nregistered_number = client.phone_numbers.registered_number(SENDER_ID)\n```\n\nMessages API\n\n```ruby\nmessage_sent = client.messages.send_text(sender_id: SENDER_ID, recipient_number: RECIPIENT_NUMBER,\n                                      message: \"Hey there! it's Whatsapp Ruby SDK\")\n```\n\nCheck the [example.rb file](https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk/blob/main/example.rb) for more examples.\n\n\u003c/details\u003e\n\n## Sneak Peek\n\n```ruby\nclient = WhatsappSdk::Api::Client.new(\"\u003cACCESS TOKEN\u003e\") # replace this with a valid access token\n\nclient.phone_numbers.register_number(SENDER_ID, 123456) # register the phone number to uplaod media and send message from.\n\n# send a text and a location\nclient.messages.send_text(sender_id: SENDER_ID, recipient_number: RECIPIENT_NUMBER,message: \"Hey there! it's Whatsapp Ruby SDK\")\n\nclient.messages.send_location(sender_id: SENDER_ID, recipient_number: RECIPIENT_NUMBER, longitude: -75.6898604, latitude: 45.4192206, name: \"Ignacio\", address: \"My house\")\n\n# upload a photo and send it\nimage = client.media.upload(sender_id: SENDER_ID, file_path: \"test/fixtures/assets/whatsapp.png\", type: \"image/png\")\nclient.messages.send_image(sender_id: SENDER_ID, recipient_number: RECIPIENT_NUMBER, image_id: image.id)\n\n# upload a sticker and send it\nsticker = client.media.upload(sender_id: SENDER_ID, file_path: \"test/fixtures/assets/sticker.webp\", type: \"image/webp\")\nclient.messages.send_sticker(sender_id: SENDER_ID, recipient_number: RECIPIENT_NUMBER, sticker_id: sticker.id)\n```\n\n## APIs\n\n### Templates\n\n\u003cdetails\u003e\n\n```ruby\n# Get list of templates\nclient.templates.list(business_id: BUSINESS_ID)\n\n# Get Message Template Namespace\n# The message template namespace is required to send messages using the message templates.\nclient.templates.get_message_template_namespace(business_id: BUSINESS_ID)\n\n# Create a template\nclient.templates.create(\n  business_id: BUSINESS_ID, name: \"seasonal_promotion\", language: \"en_US\", category: \"MARKETING\",\n  components_json: components_json, allow_category_change: true\n)\n\n# Delete a template\nclient.templates.delete(business_id: BUSINESS_ID, name: \"my_name\") # delete by name\n```\n\u003c/details\u003e\n\n### Business Profile API\n\n\u003cdetails\u003e\n\n```ruby\n# Get the details of your business\nclient.business_profiles.get(phone_number_id)\n\n# Update the details of your business\nclient.business_profiles.update(phone_number_id: SENDER_ID, params: { about: \"A very cool business\" } )\n```\n\u003c/details\u003e\n\n### Phone numbers API\n\n\u003cdetails\u003e\n\n```ruby\n# Get the list of phone numbers registered\nclient.phone_numbers.list(business_id)\n\n# Get the a phone number by id\nclient.phone_numbers.get(phone_number_id)\n\n# Register a phone number\nclient.phone_numbers.register_number(phone_number_id, pin)\n\n# Deregister a phone number\nclient.phone_numbers.deregister_number(phone_number_id)\n```\n\n\u003c/details\u003e\n\n### Media API\n\n\u003cdetails\u003e\n\n```ruby\n# Upload a media\nclient.media.upload(sender_id: SENDER_ID, file_path: \"tmp/whatsapp.png\", type: \"image/png\")\n\n# Get a media\nmedia = client.media.get(media_id: MEDIA_ID)\n\n# Download media\nclient.media.download(url: MEDIA_URL, file_path: 'tmp/downloaded_whatsapp.png', media_type: \"image/png\")\n\n# Delete a media\nclient.media.delete(media_id: MEDIA_ID)\n```\n\u003c/details\u003e\n\n### Messages API\n\n\u003cdetails\u003e\n\n```ruby\n# Send a text message\nclient.messages.send_text(sender_id: 1234, recipient_number: 112345678, message: \"hola\")\n\n# Read a message\nclient.messages.read_message(sender_id: 1234, message_id: \"wamid.HBgLMTM0M12345678910=\")\n\n# Note: To get the `message_id` you can set up [Webhooks](https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks/components) that will listen and fire an event when a message is received.\n\n# Send a reaction to message\n#   To send a reaction to a message, you need to obtain the message id and look for the emoji's unicode you want to use.\nclient.messages.send_reaction(sender_id: 123_123, recipient_number: 56_789, message_id: \"12345\", emoji: \"\\u{1f550}\")\nclient.messages.send_reaction(sender_id: 123_123, recipient_number: 56_789, message_id: \"12345\", emoji: \"⛄️\")\n\n# Reply to a message\n# To reply to a message, just include the id of the message in the `client.messages` methods. For example, to reply to a text message include the following:\nclient.messages.send_text(sender_id: 123_123, recipient_number: 56_789, message: \"I'm a reply\", message_id: \"wamid.1234\")\n\n# Send a location message\nclient.messages.send_location(\n  sender_id: 123123, recipient_number: 56789,\n  longitude: 45.4215, latitude: 75.6972, name: \"nacho\", address: \"141 cooper street\"\n)\n\n# Send an image message\n#  It uses a link or an image_id.\n#  with a link\nclient.messages.send_image(sender_id: 123123, recipient_number: 56789, link: \"image_link\", caption: \"Ignacio Chiazzo Profile\")\n\n# with an image id\nclient.messages.send_image(sender_id: 123123, recipient_number: 56789, image_id: \"1234\", caption: \"Ignacio Chiazzo Profile\")\n\n\n# Send an audio message\n# It uses a link or an audio_id.\n# with a link\nclient.messages.send_audio(sender_id: 123123, recipient_number: 56789, link: \"audio_link\")\n\n# with an audio id\nclient.messages.send_audio(sender_id: 123123, recipient_number: 56789, audio_id: \"1234\")\n\n# Send a document message\n# It uses a link or a document_id.\n# with a link\nclient.messages.send_document(sender_id: 123123, recipient_number: 56789, link: \"document_link\", caption: \"Ignacio Chiazzo\")\n\n# with a document id\nclient.messages.send_document(sender_id: 123123, recipient_number: 56789, document_id: \"1234\", caption: \"Ignacio Chiazzo\")\n# Note, you can specify the filename via argument [`filename`](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages). \n\n# Send a sticker message\n#  It could use a link or a sticker_id.\n#  with a link\nclient.messages.send_sticker(sender_id: 123123, recipient_number: 56789, link: \"link\")\n\n# with a sticker_id\nclient.messages.send_sticker(sender_id: 123123, recipient_number: 56789, sticker_id: \"1234\")\n\n# Send contacts message\n# To send a contact, you need to create a Contact instance object that contain objects embedded like `addresses`, `birthday`, `emails`, `name`, `org`. See this [guide](/test/contact_helper.rb) to learn how to create contacts objects.\nclient.messages.send_contacts(sender_id: 123123, recipient_number: 56789, contacts: [create_contact(params)])\n\n# Alternatively, you could pass a plain json like this:\nclient.messages.send_contacts(sender_id: 123123, recipient_number: 56789, contacts_json: {...})\n\n# Send a template message\n# WhatsApp message templates are specific message formats that businesses use to send out notifications or customer care messages to people that have opted in to notifications. Messages can include appointment reminders, shipping information, issue resolution or payment updates.\n\n# Before sending a message template, you need to create one. visit the [Official API Documentation](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-message-templates)\n```\n\n\u003cdetails\u003e \u003csummary\u003eComponent's example\u003c/summary\u003e\n\n```ruby\ncurrency = WhatsappSdk::Resource::Currency.new(code: \"USD\", amount: 1000, fallback_value: \"1000\")\ndate_time = WhatsappSdk::Resource::DateTime.new(fallback_value: \"2020-01-01T00:00:00Z\")\nmedia_component = WhatsappSdk::Resource::MediaComponent.new(type: \"image\", link: \"http(s)://URL\")\nlocation = WhatsappSdk::Resource::Location.new(\n  latitude: 25.779510, longitude: -80.338631, name: \"miami store\", address: \"820 nw 87th ave, miami, fl\"\n)\n\nparameter_image = WhatsappSdk::Resource::ParameterObject.new(type: \"image\", image: media_component)\nparameter_text = WhatsappSdk::Resource::ParameterObject.new(type: \"text\", text: \"TEXT_STRING\")\nparameter_currency = WhatsappSdk::Resource::ParameterObject.new(type: \"currency\", currency: currency)\nparameter_date_time = WhatsappSdk::Resource::ParameterObject.new(type: \"date_time\", date_time: date_time)\nparameter_location = WhatsappSdk::Resource::ParameterObject.new(type: \"location\", location: location)\n\nheader_component = WhatsappSdk::Resource::Component.new(type: \"header\", parameters: [parameter_image])\n\nbody_component = WhatsappSdk::Resource::Component.new(\n  type: \"body\", \n  parameters: [parameter_text, parameter_currency, parameter_date_time]\n)\n\nbutton_component1 = WhatsappSdk::Resource::Component.new(\n  type: \"button\",\n  index: 0,\n  sub_type: \"quick_reply\",\n  parameters: [\n    WhatsappSdk::Resource::ButtonParameter.new(type: \"payload\", payload: \"PAYLOAD\")\n  ]\n)\n\nbutton_component2 = WhatsappSdk::Resource::Component.new(\n  type: \"button\",\n  index: 1,\n  sub_type: \"quick_reply\",\n  parameters: [\n    WhatsappSdk::Resource::ButtonParameter.new(type: \"payload\", payload: \"PAYLOAD\")\n  ]\n)\n\nlocation_component = WhatsappSdk::Resource::Component.new(type: \"header\", parameters: [parameter_location])\nclient.messages.send_template(\n  sender_id: 12_345, recipient_number: 12345678, name: \"hello_world\", language: \"en_US\", components: [...]\n)\n```\n\n\u003c/details\u003e\n\nAlternatively, you could pass a plain json like this:\n\n```ruby\nclient.messages.send_template(sender_id: 12_345, recipient_number: 12345678, name: \"hello_world\", language: \"en_US\", components_json: [{...}])\n```\n\n**Send interactive messages**\nVisit the [Official API Documentation](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#interactive-messages)\n\n\u003cdetails\u003e\n\u003csummary\u003eList Message's example\u003c/summary\u003e\n\n```ruby\ninteractive_header = WhatsappSdk::Resource::InteractiveHeader.new(type: \"text\", text: \"I am the header!\")\ninteractive_body = WhatsappSdk::Resource::InteractiveBody.new(text: \"I am the body!\")\ninteractive_footer = WhatsappSdk::Resource::InteractiveFooter.new(text: \"I am the footer!\")\ninteractive_action = WhatsappSdk::Resource::InteractiveAction.new(type: \"list_message\")\n\ninteractive_action.button = \"I am the button CTA\"\n\ninteractive_section_1 = WhatsappSdk::Resource::InteractiveActionSection.new(title: \"I am the section 1\")\ninteractive_section_1_row_1 = WhatsappSdk::Resource::InteractiveActionSectionRow.new(\n  title: \"I am the row 1 title\",\n  id: \"section_1_row_1\",\n  description: \"I am the optional section 1 row 1 description\"\n)\ninteractive_section_1.add_row(interactive_section_1_row_1)\ninteractive_action.add_section(interactive_section_1)\n\ninteractive_list_messages = WhatsappSdk::Resource::Interactive.new(\n  type: \"list\",\n  header: interactive_header,\n  body: interactive_body,\n  footer: interactive_footer,\n  action: interactive_action\n)\n\nclient.messages.send_interactive_list_messages(\n  sender_id: SENDER_ID, recipient_number: RECIPIENT_NUMBER,\n  interactive: interactive_list_messages\n)\n```\n\n\u003c/details\u003e\n\nAlternatively, you could pass a plain json like this:\n\n```ruby\nclient.messages.send_interactive_list_messages(\n  sender_id: 12_345, recipient_number: 1234567890\n  interactive_json: {...}\n)\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eReply Button's example\u003c/summary\u003e\n\n```ruby\ninteractive_header = WhatsappSdk::Resource::InteractiveHeader.new(type: \"text\", text: \"I am the header!\")\ninteractive_body = WhatsappSdk::Resource::InteractiveBody.new(text: \"I am the body!\")\ninteractive_footer = WhatsappSdk::Resource::InteractiveFooter.new(text: \"I am the footer!\")\n\ninteractive_action = WhatsappSdk::Resource::InteractiveAction.new(type: \"reply_button\")\ninteractive_reply_button_1 = WhatsappSdk::Resource::InteractiveActionReplyButton.new(\n  title: \"I am the reply button 1\",\n  id: \"button_1\"\n)\ninteractive_action.add_reply_button(interactive_reply_button_1)\n\ninteractive_reply_button_2 = WhatsappSdk::Resource::InteractiveActionReplyButton.new(\n  title: \"I am the reply button 2\",\n  id: \"button_2\"\n)\ninteractive_action.add_reply_button(interactive_reply_button_2)\n\ninteractive_reply_buttons = WhatsappSdk::Resource::Interactive.new(\n  type: \"reply_button\",\n  header: interactive_header,\n  body: interactive_body,\n  footer: interactive_footer,\n  action: interactive_action\n)\n\nclient.messages.send_interactive_reply_buttons(\n  sender_id: 12_345, recipient_number: 1234567890,\n  interactive: interactive_reply_buttons\n)\n```\n\n\u003c/details\u003e\n\nAlternative, you could pass a plain json like this:\n\n```ruby\nclient.messages.send_interactive_reply_buttons(\n  sender_id: 12_345, recipient_number: 1234567890\n  interactive_json: {...}\n)\n```\n\n\u003c/details\u003e\n\n### Errors\n\nIf the API returns an error then an exception `WhatsappSdk::Api::Responses::HttpResponseError` is raised. The  object contains information returned by the Cloud API. For more information about the potential error check the [official documentation](https://developers.facebook.com/docs/whatsapp/cloud-api/support/error-codes/).\n\n## Examples\n\nVisit [the example file](/example.rb) with examples to call the API in a single file.\n\n## Whatsapp Cloud API\n\n- See the [official documentation](https://developers.facebook.com/docs/whatsapp/cloud-api) for the Whatsapp Cloud API.\n- For pricing, refer to the [official documentation](https://developers.facebook.com/docs/whatsapp/pricing/). As of today, Whatsapp offers have 1000 conversations free per month.\n\n## Troubleshooting\n\nIf you try to send a text message directly without a message template created and approved in your Meta control panel, you can't start a chat with other people. But if you receive a message before, it's possible to send a message.\n\nIf the API response is still `success`, but the message is not delivered:\n  - ensure the device you're sending the message to is using a supported Whatsapp version. [Check documentation](https://developers.facebook.com/docs/whatsapp/cloud-api/support/troubleshooting#message-not-delivered). Try also replying a message to the number you are registered on your Whatsapp.\n- Ensure your Meta App uses an API version greater than or equal to `v.14`.\n- Ensure that the Panel in the Facebook dashboard doesn't display any errors.\n\nNote: Sometimes the messages are delayed; see [Meta documentation](https://developers.facebook.com/docs/whatsapp/on-premises/guides/send-message-performance#delays).\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests.\n\nRun ' bundle exec rake install' to install this gem onto your local machine. 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### Run all the tests\n\n- **Unit tests:** Run `rake test`\n- **Sorbet Typecheck:** run `srb tc`\n- **Linters:** `bundle exec rubocop`\n\nTo update the Cloud API version update the version in `lib/whatsapp_sdk/api/api_configuration.rb`. Check the [Cloud API changelog for API udpates](https://developers.facebook.com/docs/whatsapp/business-platform/changelog#api-error-response-behavior).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at [https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk](https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk) 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\nIf you want a feature to be implemented in the gem, please, open an issue and we will take a look as soon as we can.\n\nDo you want to contribute and are unsure where to start? Ping me on Twitter, and I will help you!\n\nCheck [Contributing](/CONTRIBUTING.MD) file.\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%2Fignacio-chiazzo%2Fruby_whatsapp_sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fignacio-chiazzo%2Fruby_whatsapp_sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fignacio-chiazzo%2Fruby_whatsapp_sdk/lists"}