API whatsgate.ru
- API version: 1.0.0
- Build date: 2022-09-07T09:16:17.666Z[GMT]
Интерфейс для взаимодействия с клиентом Whatsapp
For more information, please visit https://whatsgate.ru/
Automatically generated by the Swagger Codegen
Building the API client library requires:
- Java 1.7+
- Maven/Gradle
To install the API client library to your local Maven repository, simply execute:
mvn clean installTo deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deployRefer to the OSSRH Guide for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-java-client</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>Add this dependency to your project's build file:
compile "io.swagger:swagger-java-client:1.0.0"At first generate the JAR by executing:
mvn clean packageThen manually install the following JARs:
target/swagger-java-client-1.0.0.jartarget/lib/*.jar
Please follow the installation instruction and execute the following Java code:
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 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");
DefaultApi apiInstance = new DefaultApi();
CheckBody body = new CheckBody(); // CheckBody | Проверяет, зарегистрирован ли указанный номер в WhatsApp. Номер указывается в формате только цифр, например 79999999999
try {
InlineResponse2001 result = apiInstance.checkPost(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#checkPost");
e.printStackTrace();
}
}
}
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 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");
DefaultApi apiInstance = new DefaultApi();
GetchatsBody body = new GetchatsBody(); // GetchatsBody | Запрашивает и возвращает список активных чатов, включая контакты и группы. В объекте группы находится идентификатор группы, список всех участников группы, права участников (является ли участник администратором группы).
try {
InlineResponse2002 result = apiInstance.getChatsPost(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#getChatsPost");
e.printStackTrace();
}
}
}
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 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");
DefaultApi apiInstance = new DefaultApi();
SeenBody body = new SeenBody(); // SeenBody | Команда устанавливает у всех сообщений в указанном чате статус просмотрены.
try {
InlineResponse2004 result = apiInstance.seenPost(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#seenPost");
e.printStackTrace();
}
}
}
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 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");
DefaultApi apiInstance = new DefaultApi();
SendBody body = new SendBody(); // SendBody | Отправляет текстовое или мультимедийное сообщение контакту либо группе. Может использоваться синхронно (возвращает ответ после отправки сообщения, ответ содержит объект отправленного сообщения с идентификатором), либо асинхронно (ответ содержит результат постановки в очередь, а отправленное сообщение приходит на указанный webhook). По умолчанию используется асинхронная отправка.
try {
InlineResponse200 result = apiInstance.sendMessage(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#sendMessage");
e.printStackTrace();
}
}
}All URIs are relative to https://whatsgate.ru/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| DefaultApi | checkPost | POST /check | Проверка зарегистрирован ли номер в WhatsApp |
| DefaultApi | getChatsPost | POST /get-chats | Возвращает список активных чатов |
| DefaultApi | seenPost | POST /seen | Отправляет команду в чат, что последние сообщения просмотрены |
| DefaultApi | sendMessage | POST /send | Отправка сообщения |
| _Api | getMediaPost | POST /get-media | Возвращает объект медиафайла, прикрепленного к сообщению |
- AnyOfseenBodyRecipient
- AnyOfsendBodyMessage
- AnyOfsendBodyRecipient
- CheckBody
- Error
- GetchatsBody
- GetmediaBody
- InlineResponse200
- InlineResponse2001
- InlineResponse2002
- InlineResponse2003
- InlineResponse2004
- Media
- MessageMedia
- MessageText
- OneOfinlineResponse200Result
- RecipientId
- RecipientNum
- ResponseChat
- ResponseChatGroupMetadata
- ResponseChatGroupMetadataParticipants
- ResponseMessage
- SeenBody
- SendBody
Authentication schemes defined for the API:
- Type: API key
- API key parameter name: X-API-Key
- Location: HTTP header
It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.