WhatsAPI Go
- API version: 2.0
- Build date: 2022-11-30T17:55:55.962510800+05:30[Asia/Calcutta]
The V2 of WhatsAPI Go
Automatically generated by the OpenAPI Generator
Building the API client library requires:
- Java 1.8+
- Maven (3.8.3+)/Gradle (7.2+)
To install the API client library to your local Maven repository, simply execute:
mvn clean install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deploy
Refer to the OSSRH Guide for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>openapi-java-client</artifactId>
<version>2.0</version>
<scope>compile</scope>
</dependency>
Add this dependency to your project's build file:
repositories {
mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central.
mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo.
}
dependencies {
implementation "org.openapitools:openapi-java-client:2.0"
}
At first generate the JAR by executing:
mvn clean package
Then manually install the following JARs:
target/openapi-java-client-2.0.jar
target/lib/*.jar
Please follow the installation instruction and execute the following Java code:
// Import classes:
import WhatsAPI.ApiClient;
import WhatsAPI.ApiException;
import WhatsAPI.Configuration;
import WhatsAPI.auth.*;
import WhatsAPI.models.*;
import whatsapi.BusinessManagementApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("/api");
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
BusinessManagementApi apiInstance = new BusinessManagementApi(defaultClient);
String instanceKey = "instanceKey_example"; // String | Instance key
try {
ModelAPIResponse result = apiInstance.fetchCatlog(instanceKey);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BusinessManagementApi#fetchCatlog");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
All URIs are relative to /api
Class | Method | HTTP request | Description |
---|---|---|---|
BusinessManagementApi | fetchCatlog | GET /instances/{instance_key}/business/catalog | Fetches the catlog. |
BusinessManagementApi | sendPaymentRequest | POST /instances/{instance_key}/business/payment-request | Send a payment request. |
GroupManagementApi | addParticipant | POST /instances/{instance_key}/groups/{group_id}/participants/add | Add participant. |
GroupManagementApi | createGroup | POST /instances/{instance_key}/groups/create | Create group. |
GroupManagementApi | demoteParticipant | PUT /instances/{instance_key}/groups/{group_id}/participants/demote | Demote participant. |
GroupManagementApi | getAdminGroups | GET /instances/{instance_key}/groups/admin | Get admin groups. |
GroupManagementApi | getAllGroups | GET /instances/{instance_key}/groups/ | Get all groups. |
GroupManagementApi | getAllParticipants | GET /instances/{instance_key}/groups/{group_id}/participants | Get all participants. |
GroupManagementApi | getGroup | GET /instances/{instance_key}/groups/{group_id} | Get group. |
GroupManagementApi | getGroupFromInviteLink | GET /instances/{instance_key}/groups/invite-info | Get group from invite link. |
GroupManagementApi | getGroupInviteCode | GET /instances/{instance_key}/groups/{group_id}/invite-code | Get group invite code. |
GroupManagementApi | joinGroupWithLink | GET /instances/{instance_key}/groups/join | Join group with invite code. |
GroupManagementApi | leaveGroup | DELETE /instances/{instance_key}/groups/{group_id}/ | Leaves the group. |
GroupManagementApi | promoteParticipant | PUT /instances/{instance_key}/groups/{group_id}/participants/promote | Promote participant. |
GroupManagementApi | removeParticipant | DELETE /instances/{instance_key}/groups/{group_id}/participants/remove | Remove participant. |
GroupManagementApi | setGroupAnnounce | PUT /instances/{instance_key}/groups/{group_id}/announce | Set group announce. |
GroupManagementApi | setGroupDescription | PUT /instances/{instance_key}/groups/{group_id}/description | Set group description. |
GroupManagementApi | setGroupLocked | PUT /instances/{instance_key}/groups/{group_id}/lock | Set group locked. |
GroupManagementApi | setGroupName | PUT /instances/{instance_key}/groups/{group_id}/name | Set group name. |
GroupManagementApi | setGroupPicture | PUT /instances/{instance_key}/groups/{group_id}/profile-pic | Set group picture. |
InstanceApi | changeWebhookUrl | PUT /instances/{instance_key}/webhook | Change Webhook url. |
InstanceApi | createInstance | POST /instances/create | Creates a new instance key. |
InstanceApi | deleteInstance | DELETE /instances/{instance_key}/delete | Delete Instance. |
InstanceApi | getContacts | GET /instances/{instance_key}/contacts | Get contacts. |
InstanceApi | getInstance | GET /instances/{instance_key}/ | Get Instance. |
InstanceApi | getQrCode | GET /instances/{instance_key}/qrcode | Get QrCode. |
InstanceApi | listInstances | GET /instances/list | Get all instances. |
InstanceApi | logoutInstance | DELETE /instances/{instance_key}/logout | Logout Instance. |
MessageSendingApi | sendAudio | POST /instances/{instance_key}/send/audio | Send raw audio. |
MessageSendingApi | sendButtonMessage | POST /instances/{instance_key}/send/buttons | Send a button message. |
MessageSendingApi | sendButtonWithMedia | POST /instances/{instance_key}/send/button-media | Send a button message with a media header. |
MessageSendingApi | sendContact | POST /instances/{instance_key}/send/contact | Send a contact message. |
MessageSendingApi | sendDocument | POST /instances/{instance_key}/send/document | Send raw document. |
MessageSendingApi | sendGroupInvite | POST /instances/{instance_key}/send/group-invite | Send a group invite message |
MessageSendingApi | sendImage | POST /instances/{instance_key}/send/image | Send raw image. |
MessageSendingApi | sendListMessage | POST /instances/{instance_key}/send/list | Send a List message. |
MessageSendingApi | sendLocation | POST /instances/{instance_key}/send/location | Send a location message. |
MessageSendingApi | sendMediaMessage | POST /instances/{instance_key}/send/media | Send a media message. |
MessageSendingApi | sendPollMessage | POST /instances/{instance_key}/send/poll | Send a Poll message. |
MessageSendingApi | sendTemplate | POST /instances/{instance_key}/send/template | Send a template message. |
MessageSendingApi | sendTemplateWithMedia | POST /instances/{instance_key}/send/template-media | Send a template message with media. |
MessageSendingApi | sendTextMessage | POST /instances/{instance_key}/send/text | Send a text message. |
MessageSendingApi | sendVideo | POST /instances/{instance_key}/send/video | Send raw video. |
MessageSendingApi | uploadMedia | POST /instances/{instance_key}/send/upload | Upload media. |
MessageSendingApi | uploadMediaFromUrl | POST /instances/{instance_key}/send/upload-url | Upload media from url. |
MiscellaneousApi | downloadMedia | POST /instances/{instance_key}/misc/download | Download media |
MiscellaneousApi | getProfilePic | GET /instances/{instance_key}/misc/profile-pic | Get profile pic. |
MiscellaneousApi | getUsersInfo | POST /instances/{instance_key}/misc/user-info | Fetches the users info. |
MiscellaneousApi | setChatPresence | POST /instances/{instance_key}/misc/chat-presence | Set chat presence |
MiscellaneousApi | updateProfilePic | PUT /instances/{instance_key}/misc/profile-pic | Update profile picture |
- ButtonMessagePayload
- ButtonMessageWithMediaPayload
- ContactMessagePayload
- ContactMessagePayloadVcard
- CreateInstancePayload
- FileUpload
- GroupCreatePayload
- GroupInviteMessagePayload
- GroupUpdateDescriptionPayload
- GroupUpdateNamePayload
- GroupUpdateParticipantsPayload
- ListItem
- ListMessagePayload
- ListSection
- LocationMessagePayload
- LocationMessagePayloadLocation
- ModelAPIResponse
- PaymentRequestPayload
- PollMessagePayload
- ReplyButton
- SendAudioRequest
- SendDocumentRequest
- SendMediaPayload
- SendVideoRequest
- SetGroupPictureRequest
- TemplateButton
- TemplateButtonPayload
- TemplateButtonWithMediaPayload
- TextMessage
- UpdateProfilePicRequest
- UploadMediaRequest
- UrlMediaUploadPayload
- UserInfoPayload
- WebhookPayload
Authentication schemes defined for the API:
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issues.