{"id":18051727,"url":"https://github.com/apimatic/whatsapp-java-sdk","last_synced_at":"2025-04-05T07:13:38.768Z","repository":{"id":37098107,"uuid":"504458357","full_name":"apimatic/whatsapp-java-sdk","owner":"apimatic","description":null,"archived":false,"fork":false,"pushed_at":"2022-06-17T08:46:01.000Z","size":129,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-10T14:53:16.033Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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:43:57.000Z","updated_at":"2022-06-17T08:46:06.000Z","dependencies_parsed_at":"2022-06-24T12:34:41.869Z","dependency_job_id":null,"html_url":"https://github.com/apimatic/whatsapp-java-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-java-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apimatic%2Fwhatsapp-java-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apimatic%2Fwhatsapp-java-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apimatic%2Fwhatsapp-java-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apimatic","download_url":"https://codeload.github.com/apimatic/whatsapp-java-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:22.312Z","updated_at":"2025-04-05T07:13:38.754Z","avatar_url":"https://github.com/apimatic.png","language":"Java","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 uses a few Maven dependencies e.g., Jackson, OkHttp,\nand Apache HttpClient. The reference to these dependencies is already\nadded in the pom.xml file will be installed automatically. Therefore,\nyou will need internet access for a successful build.\r\n\r\n* In order to open the client library in Eclipse click on `File -\u003e Import`.\r\n\r\n![Importing SDK into Eclipse - Step 1](https://apidocs.io/illustration/java?workspaceFolder=WhatsApp%20Cloud%20API-Java\u0026workspaceName=WhatsAppCloudAPI\u0026projectName=WhatsAppCloudAPILib\u0026rootNamespace=com.facebook.graph\u0026groupId=WhatsAppCloudAPILib\u0026artifactId=whats-app-cloud-apilib\u0026version=1.0.0\u0026step=import0)\r\n\r\n* In the import dialog, select `Existing Java Project` and click `Next`.\r\n\r\n![Importing SDK into Eclipse - Step 2](https://apidocs.io/illustration/java?workspaceFolder=WhatsApp%20Cloud%20API-Java\u0026workspaceName=WhatsAppCloudAPI\u0026projectName=WhatsAppCloudAPILib\u0026rootNamespace=com.facebook.graph\u0026groupId=WhatsAppCloudAPILib\u0026artifactId=whats-app-cloud-apilib\u0026version=1.0.0\u0026step=import1)\r\n\r\n* Browse to locate the folder containing the source code. Select the detected location of the project and click `Finish`.\r\n\r\n![Importing SDK into Eclipse - Step 3](https://apidocs.io/illustration/java?workspaceFolder=WhatsApp%20Cloud%20API-Java\u0026workspaceName=WhatsAppCloudAPI\u0026projectName=WhatsAppCloudAPILib\u0026rootNamespace=com.facebook.graph\u0026groupId=WhatsAppCloudAPILib\u0026artifactId=whats-app-cloud-apilib\u0026version=1.0.0\u0026step=import2)\r\n\r\n* Upon successful import, the project will be automatically built by Eclipse after automatically resolving the dependencies.\r\n\r\n![Importing SDK into Eclipse - Step 4](https://apidocs.io/illustration/java?workspaceFolder=WhatsApp%20Cloud%20API-Java\u0026workspaceName=WhatsAppCloudAPI\u0026projectName=WhatsAppCloudAPILib\u0026rootNamespace=com.facebook.graph\u0026groupId=WhatsAppCloudAPILib\u0026artifactId=whats-app-cloud-apilib\u0026version=1.0.0\u0026step=import3)\r\n\r\n## Installation\r\n\r\nThe following section explains how to use the WhatsAppCloudAPILib library in a new project.\r\n\r\n### 1. Starting a new project\r\n\r\nFor starting a new project, click the menu command `File \u003e New \u003e Project`.\r\n\r\n![Add a new project in Eclipse](https://apidocs.io/illustration/java?workspaceFolder=WhatsApp%20Cloud%20API-Java\u0026workspaceName=WhatsAppCloudAPI\u0026projectName=WhatsAppCloudAPILib\u0026rootNamespace=com.facebook.graph\u0026groupId=WhatsAppCloudAPILib\u0026artifactId=whats-app-cloud-apilib\u0026version=1.0.0\u0026step=createNewProject0)\r\n\r\nNext, choose `Maven \u003e Maven Project` and click `Next`.\r\n\r\n![Create a new Maven Project - Step 1](https://apidocs.io/illustration/java?workspaceFolder=WhatsApp%20Cloud%20API-Java\u0026workspaceName=WhatsAppCloudAPI\u0026projectName=WhatsAppCloudAPILib\u0026rootNamespace=com.facebook.graph\u0026groupId=WhatsAppCloudAPILib\u0026artifactId=whats-app-cloud-apilib\u0026version=1.0.0\u0026step=createNewProject1)\r\n\r\nHere, make sure to use the current workspace by choosing `Use default Workspace location`, as shown in the picture below and click `Next`.\r\n\r\n![Create a new Maven Project - Step 2](https://apidocs.io/illustration/java?workspaceFolder=WhatsApp%20Cloud%20API-Java\u0026workspaceName=WhatsAppCloudAPI\u0026projectName=WhatsAppCloudAPILib\u0026rootNamespace=com.facebook.graph\u0026groupId=WhatsAppCloudAPILib\u0026artifactId=whats-app-cloud-apilib\u0026version=1.0.0\u0026step=createNewProject2)\r\n\r\nFollowing this, select the *quick start* project type to create a simple project with an existing class and a `main` method. To do this, choose `maven-archetype-quickstart` item from the list and click `Next`.\r\n\r\n![Create a new Maven Project - Step 3](https://apidocs.io/illustration/java?workspaceFolder=WhatsApp%20Cloud%20API-Java\u0026workspaceName=WhatsAppCloudAPI\u0026projectName=WhatsAppCloudAPILib\u0026rootNamespace=com.facebook.graph\u0026groupId=WhatsAppCloudAPILib\u0026artifactId=whats-app-cloud-apilib\u0026version=1.0.0\u0026step=createNewProject3)\r\n\r\nIn the last step, provide a `Group Id` and `Artifact Id` as shown in the picture below and click `Finish`.\r\n\r\n![Create a new Maven Project - Step 4](https://apidocs.io/illustration/java?workspaceFolder=WhatsApp%20Cloud%20API-Java\u0026workspaceName=WhatsAppCloudAPI\u0026projectName=WhatsAppCloudAPILib\u0026rootNamespace=com.facebook.graph\u0026groupId=WhatsAppCloudAPILib\u0026artifactId=whats-app-cloud-apilib\u0026version=1.0.0\u0026step=createNewProject4)\r\n\r\n### 2. Add reference of the library project\r\n\r\nThe created Maven project manages its dependencies using its `pom.xml` file. In order to add a dependency on the *WhatsAppCloudAPILib* client library, double click on the `pom.xml` file in the `Package Explorer`. Opening the `pom.xml` file will render a graphical view on the canvas. Here, switch to the `Dependencies` tab and click the `Add` button as shown in the picture below.\r\n\r\n![Adding dependency to the client library - Step 1](https://apidocs.io/illustration/java?workspaceFolder=WhatsApp%20Cloud%20API-Java\u0026workspaceName=WhatsAppCloudAPI\u0026projectName=WhatsAppCloudAPILib\u0026rootNamespace=com.facebook.graph\u0026groupId=WhatsAppCloudAPILib\u0026artifactId=whats-app-cloud-apilib\u0026version=1.0.0\u0026step=testProject0)\r\n\r\nClicking the `Add` button will open a dialog where you need to specify WhatsAppCloudAPILib in `Group Id`, whats-app-cloud-apilib in `Artifact Id` and 1.0.0 in the `Version` fields. Once added click `OK`. Save the `pom.xml` file.\r\n\r\n![Adding dependency to the client library - Step 2](https://apidocs.io/illustration/java?workspaceFolder=WhatsApp%20Cloud%20API-Java\u0026workspaceName=WhatsAppCloudAPI\u0026projectName=WhatsAppCloudAPILib\u0026rootNamespace=com.facebook.graph\u0026groupId=WhatsAppCloudAPILib\u0026artifactId=whats-app-cloud-apilib\u0026version=1.0.0\u0026step=testProject1)\r\n\r\n![Adding sample code](https://apidocs.io/illustration/java?workspaceFolder=WhatsApp%20Cloud%20API-Java\u0026workspaceName=WhatsAppCloudAPI\u0026projectName=WhatsAppCloudAPILib\u0026rootNamespace=com.facebook.graph\u0026groupId=WhatsAppCloudAPILib\u0026artifactId=whats-app-cloud-apilib\u0026version=1.0.0\u0026step=testProject2)\r\n\r\n### 3. Write sample code\r\n\r\nOnce the `SimpleConsoleApp` is created, a file named `App.java` will be visible in the *Package Explorer* with a `main` method. This is the entry point for the execution of the created project.\nHere, you can add code to initialize the client library and instantiate a *Controller* class. Sample code to initialize the client library and using controller methods is given in the subsequent sections.\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| `version` | `String` | *Default*: `\"v13.0\"` |\r\n| `environment` | Environment | The API environment. \u003cbr\u003e **Default: `Environment.PRODUCTION`** |\r\n| `httpClientConfig` | `ReadonlyHttpClientConfiguration` | Http Client Configuration instance. |\r\n| `accessToken` | `String` | The OAuth 2.0 Access Token to use for API requests. |\r\n\r\nThe API client can be initialized as follows:\r\n\r\n```java\r\nWhatsAppCloudAPIClient client = new WhatsAppCloudAPIClient.Builder()\n    .httpClientConfig(configBuilder -\u003e configBuilder\n            .timeout(0))\n    .accessToken(\"AccessToken\")\n    .environment(Environment.PRODUCTION)\n    .version(\"v13.0\")\n    .build();\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* [HttpRequest](doc/http-request.md)\n* [HttpResponse](doc/http-response.md)\n* [HttpStringResponse](doc/http-string-response.md)\n* [HttpContext](doc/http-context.md)\n* [HttpBodyRequest](doc/http-body-request.md)\n* [Headers](doc/headers.md)\n* [ApiException](doc/api-exception.md)\n* [Configuration Interface](doc/configuration-interface.md)\n* [HttpClientConfiguration](doc/http-client-configuration.md)\n* [HttpClientConfiguration.Builder](doc/http-client-configuration-builder.md)\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapimatic%2Fwhatsapp-java-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapimatic%2Fwhatsapp-java-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapimatic%2Fwhatsapp-java-sdk/lists"}