{"id":18051730,"url":"https://github.com/apimatic/whatsapp-ruby-sdk","last_synced_at":"2025-04-05T07:13:40.616Z","repository":{"id":37097994,"uuid":"504459992","full_name":"apimatic/whatsapp-ruby-sdk","owner":"apimatic","description":null,"archived":false,"fork":false,"pushed_at":"2022-06-17T08:50:07.000Z","size":83,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-10T14:53:16.366Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apimatic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-17T08:49:07.000Z","updated_at":"2023-10-21T19:41:31.000Z","dependencies_parsed_at":"2022-06-24T12:53:37.919Z","dependency_job_id":null,"html_url":"https://github.com/apimatic/whatsapp-ruby-sdk","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/apimatic%2Fwhatsapp-ruby-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apimatic%2Fwhatsapp-ruby-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apimatic%2Fwhatsapp-ruby-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apimatic%2Fwhatsapp-ruby-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apimatic","download_url":"https://codeload.github.com/apimatic/whatsapp-ruby-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299850,"owners_count":20916193,"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":[],"created_at":"2024-10-30T22:55:23.593Z","updated_at":"2025-04-05T07:13:40.589Z","avatar_url":"https://github.com/apimatic.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\r\n# Getting Started with WhatsApp Cloud API\r\n\r\n## Introduction\r\n\r\nWelcome to the WhatsApp API from Meta.\r\n\r\nIndividual developers and existing Business Service Providers (BSPs) can now send and receive messages via the WhatsApp API using a cloud-hosted version of the WhatsApp Business API. Compared to the previous solutions, the cloud-based WhatsApp API is simpler to use and is a more cost-effective way for businesses to use WhatsApp. Please keep in mind the following configurations:\r\n\r\n| Name | Description |\n| --- | --- |\n| Version | Latest [Graph API version](https://developers.facebook.com/docs/graph-api/). For example: v13.0 |\n| User-Access-Token | Your user access token after signing up at [developers.facebook.com](https://developers.facebook.com). |\n| WABA-ID | Your WhatsApp Business Account (WABA) ID. |\n| Phone-Number-ID | ID for the phone number connected to the WhatsApp Business API. You can get this with a [Get Phone Number ID request](3184f675-d289-46f1-88e5-e2b11549c418). |\n| Business-ID | Your Business' ID. Once you have your Phone-Number-ID, make a [Get Business Profile request](#99fd3743-46cf-46c4-95b5-431c6a4eb0b0) to get your Business' ID. |\n| Recipient-Phone-Number | Phone number that you want to send a WhatsApp message to. |\n| Media-ID | ID for the media to [send a media message](#0a632754-3788-43bf-b785-ac6a73423d5a) or [media template message](#439c926a-8a6c-4972-ab2c-d99297716da9) to your customers. |\n| Media-URL | URL for the media to [download media content](#cbe5ece3-246c-48f3-b338-074187dfef66). |\r\n\r\n## Building\r\n\r\nThe generated code depends on a few Ruby gems. The references to these gems are added in the gemspec file. The easiest way to resolve the dependencies, build the gem and install it is through Rake:\r\n\r\n1. Install Rake if not already installed: `gem install rake`\n2. Install Bundler if not already installed: `gem install bundler`\n3. From terminal/cmd navigate to the root directory of the SDK.\n4. Invoke: `rake install`\r\n\r\nAlternatively, you can build and install the gem manually:\r\n\r\n1. From terminal/cmd navigate to the root directory of the SDK.\n2. Run the build command: `gem build whats_app_cloud_api.gemspec`\n3. Run the install command: `gem install whats_app_cloud_api-1.0.0.gem`\r\n\r\n![Installing Gem](https://apidocs.io/illustration/ruby?workspaceFolder=WhatsAppCloudApi\u0026gemVer=1.0.0\u0026gemName=whats_app_cloud_api\u0026step=buildSDK)\r\n\r\n## Installation\r\n\r\nThe following section explains how to use the whats_app_cloud_api ruby gem in a new Rails project using RubyMine\u0026trade;. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.\r\n\r\n### 1. Starting a new project\r\n\r\nClose any existing projects in RubyMine\u0026trade; by selecting `File -\u003e Close Project`. Next, click on `Create New Project` to create a new project from scratch.\r\n\r\n![Create a new project in RubyMine - Step 1](https://apidocs.io/illustration/ruby?workspaceFolder=WhatsAppCloudApi\u0026step=createNewProject0)\r\n\r\nNext, provide `TestApp` as the project name, choose `Rails Application` as the project type, and click `OK`.\r\n\r\n![Create a new Rails Application in RubyMine - Step 2](https://apidocs.io/illustration/ruby?workspaceFolder=WhatsAppCloudApi\u0026step=createNewProject1)\r\n\r\nIn the next dialog make sure that the correct Ruby SDK is being used (\u003e= 2.6 and \u003c 3.1) and click `OK`.\r\n\r\n![Create a new Rails Application in RubyMine - Step 3](https://apidocs.io/illustration/ruby?workspaceFolder=WhatsAppCloudApi\u0026step=createNewProject2)\r\n\r\n### 2. Add reference of the gem\r\n\r\nIn order to use the Tester gem in the new project we must add a gem reference. Locate the `Gemfile` in the Project Explorer window under the `TestApp` project node. The file contains references to all gems being used in the project. Here, add the reference to the library gem by adding the following line: `gem 'whats_app_cloud_api', '1.0.0'`\r\n\r\n![Add new reference to the Gemfile](https://apidocs.io/illustration/ruby?workspaceFolder=WhatsAppCloudApi\u0026gemVer=1.0.0\u0026gemName=whats_app_cloud_api\u0026step=addReference)\r\n\r\n### 3. Adding a new Rails Controller\r\n\r\nOnce the `TestApp` project is created, a folder named `controllers` will be visible in the *Project Explorer* under the following path: `TestApp \u003e app \u003e controllers`. Right click on this folder and select `New -\u003e Run Rails Generator...`.\r\n\r\n![Run Rails Generator on Controllers Folder](https://apidocs.io/illustration/ruby?workspaceFolder=WhatsAppCloudApi\u0026gemVer=1.0.0\u0026gemName=whats_app_cloud_api\u0026step=addCode0)\r\n\r\nSelecting the said option will popup a small window where the generator names are displayed. Here, select the `controller` template.\r\n\r\n![Create a new Controller](https://apidocs.io/illustration/ruby?workspaceFolder=WhatsAppCloudApi\u0026step=addCode1)\r\n\r\nNext, a popup window will ask you for a Controller name and included Actions. For controller name provide `Hello` and include an action named `Index` and click `OK`.\r\n\r\n![Add a new Controller](https://apidocs.io/illustration/ruby?workspaceFolder=WhatsAppCloudApi\u0026gemVer=1.0.0\u0026gemName=whats_app_cloud_api\u0026step=addCode2)\r\n\r\nA new controller class named `HelloController` will be created in a file named `hello_controller.rb` containing a method named `Index`. In this method, add code for initialization and a sample for its usage.\r\n\r\n![Initialize the library](https://apidocs.io/illustration/ruby?workspaceFolder=WhatsAppCloudApi\u0026gemName=whats_app_cloud_api\u0026step=addCode3)\r\n\r\n## Initialize the API Client\r\n\r\n**_Note:_** Documentation for the client can be found [here.](doc/client.md)\r\n\r\nThe following parameters are configurable for the API Client:\r\n\r\n| Parameter | Type | Description |\r\n|  --- | --- | --- |\r\n| `access_token` | `String` | The OAuth 2.0 Access Token to use for API requests. |\r\n| `version` | `String` | *Default*: `'v13.0'` |\r\n| `environment` | Environment | The API environment. \u003cbr\u003e **Default: `Environment.PRODUCTION`** |\r\n| `connection` | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |\r\n| `adapter` | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |\r\n| `timeout` | `Float` | The value to use for connection timeout. \u003cbr\u003e **Default: 60** |\r\n| `max_retries` | `Integer` | The number of times to retry an endpoint call if it fails. \u003cbr\u003e **Default: 0** |\r\n| `retry_interval` | `Float` | Pause in seconds between retries. \u003cbr\u003e **Default: 1** |\r\n| `backoff_factor` | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. \u003cbr\u003e **Default: 2** |\r\n| `retry_statuses` | `Array` | A list of HTTP statuses to retry. \u003cbr\u003e **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |\r\n| `retry_methods` | `Array` | A list of HTTP methods to retry. \u003cbr\u003e **Default: %i[get put]** |\r\n\r\nThe API client can be initialized as follows:\r\n\r\n```ruby\r\nclient = WhatsAppCloudApi::Client.new(\n  access_token: 'AccessToken',\n  environment: Environment::PRODUCTION,\n  version: 'v13.0',\r\n)\r\n```\r\n\r\n## Authorization\r\n\r\nThis API uses `OAuth 2 Bearer token`.\r\n\r\n## List of APIs\r\n\r\n* [Business Profiles](doc/controllers/business-profiles.md)\n* [Phone Numbers](doc/controllers/phone-numbers.md)\n* [Two-Step Verification](doc/controllers/two-step-verification.md)\n* [Messages](doc/controllers/messages.md)\n* [Registration](doc/controllers/registration.md)\n* [Media](doc/controllers/media.md)\r\n\r\n## Classes Documentation\r\n\r\n* [Utility Classes](doc/utility-classes.md)\n* [HttpResponse](doc/http-response.md)\n* [HttpRequest](doc/http-request.md)\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapimatic%2Fwhatsapp-ruby-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapimatic%2Fwhatsapp-ruby-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapimatic%2Fwhatsapp-ruby-sdk/lists"}