Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ben221199/WAPI
The WhatsApp API
https://github.com/ben221199/WAPI
curve25519 java json libsignal maven noiseprotocol whatsapp xmpp
Last synced: 2 months ago
JSON representation
The WhatsApp API
- Host: GitHub
- URL: https://github.com/ben221199/WAPI
- Owner: ben221199
- License: gpl-3.0
- Created: 2018-12-08T20:21:31.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-19T16:21:14.000Z (3 months ago)
- Last Synced: 2024-10-10T01:40:54.639Z (3 months ago)
- Topics: curve25519, java, json, libsignal, maven, noiseprotocol, whatsapp, xmpp
- Language: Java
- Homepage: https://github.com/ben221199/WAPI
- Size: 771 KB
- Stars: 81
- Watchers: 9
- Forks: 51
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# WAPI - The WhatsApp API
Connect your project to WhatsApp!
## Installation
First, add the JitPack repository to your POM:
```xmljitpack.io
https://jitpack.io```
Then, add the following dependency to your POM:
```xmlcom.github.ben221199
WAPI
master```
## Usage
### Verification
```java
import nl.ben221199.wapi.Verification;public class VerificationExample{
public static void main(String... args){
String userAgent = "";
boolean encrypted = true;//Check if account already exists
String[] existParams = {};
Verification.exist(userAgent,encrypted,existParams);//Request code
String[] codeParams = {};
Verification.code(userAgent,encrypted,codeParams);//Register account using code
String[] registerParams = {};
Verification.register(userAgent,encrypted,registerParams);
}}
```### Connection
```java
import com.whatsapp.proto.WA4Protos;
import java.security.KeyPair;
import java.security.PublicKey;
import nl.ben221199.wapi.Connection;public class ConnectionExample{
public static void main(String... args){
//Connection arguments
byte[] edge_routing_info = null;
KeyPair client_static_keypair = null;
PublicKey server_static_key = null;
WA4Protos.ClientPayload payload = null;//Create connection
Connection conn = new Connection("g.whatsapp.net",443)
.setEdgeRoutingInfo(edge_routing_info)
.setS(client_static_keypair)
.setRS(server_static_key)
.setPayload(payload);//Start connection
conn.start();//Get IO
FunInputStream in = conn.getInputStream();
FunOutputStream out = conn.getOutputStream();
}}
```