Giter Site home page Giter Site logo

gorgeous-whatsapp's Introduction

Line RestApi

https://github.com/lovethiscode/Gorgeous_Line

Gorgeous

Telegram :gorgeous008

The WhatsApp Websocket API

  1. This project is an open source project. Considering that many people will not deploy, a test server is deployed here for testing only.

  2. The websocket maximum frame supports 10M, and the media file sent cannot exceed 10M, otherwise the websocket will be disconnected.

Test Server: ws://8.210.124.139:16090

-) Support WA Business

-) Support multiple devices to send and receive messages

Login

    //if 
     command.put("command", "login");
    command.put("userName", "xxxx");
    //config If you have logged in, you can leave it out.
    command.put("config", Base64.getEncoder().encodeToString(StringUtil.ReadFileContent("xxxx")));
    command.put("proxy_type",-1); // -1 no proxy, 0 http proxy, 1 socks5 proxy
    command.put("proxy_server", "xxx");
    command.put("proxy_port", 1234);
    command.put("proxy_username", ""); //optional
    command.put("proxy_password", ""); //optional
    command.put("reset", false); //optional if true  Will use the config you passed in.

SyncContact

    JSONObject command = new JSONObject();
    command.put("command", "SyncContact");
    JSONArray phones = new JSONArray();
    phones.add("+66xxxx6");
     command.put("task_id", 1);
    command.put("phones", phones);

GetHDHead

    JSONObject command = new JSONObject();
    command.put("task_id", 3);
    command.put("command", "GetHDHead");
    command.put("jid", "xxxx");

SetHDHead

    // 192 * 192
    JSONObject command = new JSONObject();
    command.put("task_id", 4);
    command.put("command", "SetHDHeadData");
    command.put("content", "xxxx"); // base64(file content)

SetPushName

    JSONObject command = new JSONObject();
    command.put("task_id", 111);
    command.put("command", "SetPushName");
    command.put("pushname", "xxxx");

SetStatus

    JSONObject command = new JSONObject();
    command.put("task_id", 111);
    command.put("command", "SetStatus");
    command.put("status", "xxxx");

CreateGroup

    JSONObject command = new JSONObject();
    command.put("task_id", 111);
    command.put("command", "CreateGroup");
    command.put("subject", "subject");

    
    JSONArray members = new JSONArray();
    members.put("111");
    members.put("2222");
    command.put("members", members);

ModifyGroupSubject

    JSONObject command = new JSONObject();
    command.put("task_id", 111);
    command.put("command", "ModifyGroupSubject");
    command.put("jid", "xxxx");
    command.put("subject", "xxxx");

ModifyGroupDesc

    JSONObject command = new JSONObject();
    command.put("task_id", 111);
    command.put("command", "ModifyGroupDesc");
    command.put("jid", "xxxx");
    command.put("desc", "xxxx");

GetInviteLink

    // //https://chat.whatsapp.com/ + "code"
    JSONObject command = new JSONObject();
    command.put("task_id", 111);
    command.put("command", "GetInviteLink");
    command.put("jid", "xxxx");
    command.put("reset", false); 

AcceptInviteToGroup

    // //https://chat.whatsapp.com/ + "code"
    JSONObject command = new JSONObject();
    command.put("task_id", 111);
    command.put("command", "AcceptInviteToGroup");
    command.put("token", "xxxx");

InviteGroupMember

    JSONObject command = new JSONObject();
    command.put("task_id", 111);
    command.put("command", "InviteGroupMembers");
    command.put("jid", "xxx");

    
    JSONArray members = new JSONArray();
    members.put("111");
    members.put("2222");
    command.put("members", members);

RemoveGroupMember

    JSONObject command = new JSONObject();
    command.put("task_id", 111);
    command.put("command", "RemoveGroupMembers");
    command.put("jid", "xxx");

    
    JSONArray members = new JSONArray();
    members.put("111");
    members.put("2222");
    command.put("members", members);

PromoteGroupMembers

    JSONObject command = new JSONObject();
    command.put("task_id", 111);
    command.put("command", "PromoteGroupMembers");
    command.put("jid", "xxx");

    
    JSONArray members = new JSONArray();
    members.put("111");
    members.put("2222");
    command.put("members", members);

DemoteGroupMembers

    JSONObject command = new JSONObject();
    command.put("task_id", 111);
    command.put("command", "DemoteGroupMembers");
    command.put("jid", "xxx");

    
    JSONArray members = new JSONArray();
    members.put("111");
    members.put("2222");
    command.put("members", members);

GetGroupInfo

    JSONObject command = new JSONObject();
    command.put("task_id", 111);
    command.put("command", "GetGroupInfo");
    command.put("jid", "xxxx");

LeaveGroups

    JSONObject command = new JSONObject();
    command.put("task_id", 111);
    command.put("command", "LeaveGroups");
    
    
        
    JSONArray members = new JSONArray();
    members.put("111");
    members.put("2222");
    command.put("groups", members);

SendText

    JSONObject command = new JSONObject();
    command.put("task_id", 2);
    command.put("command", "SendText");
    command.put("jid", "xxxx");
    command.put("content", "xxx");

SendImage

     command.put("task_id", 4);
    command.put("command", "SendImage");
    command.put("jid", "xxx");
    command.put("data", Base64.getEncoder().encodeToString(xx.ReadFileContent("xx")));
    command.put("thumbnail", Base64.getEncoder().encodeToString(xx.ReadFileContent("xxx")));
    command.put("caption", "hellokg");

SendDocument

    command.put("task_id", 4);
    command.put("command", "SendDocument");
    command.put("jid", "[email protected]");
    command.put("data", Base64.getEncoder().encodeToString(xx.ReadFileContent("xxxx")));
    command.put("filename", "xxxx");

SendVideo

     command.put("task_id", 4);
    command.put("command", "SendVideo");
    command.put("jid", "[email protected]");
    command.put("data", Base64.getEncoder().encodeToString(StringUtil.ReadFileContent("xxx.mp4")));
    command.put("thumbnail", Base64.getEncoder().encodeToString(StringUtil.ReadFileContent("main.jpg")));
    command.put("caption", "hellokg");
    command.put("duration", 13000);
    command.put("width", 465);
    command.put("height", 892);

SendPTT

    // AV_CODEC_ID_OPUS, 48000, 64 * 1000, 1
    command.put("task_id", 4);
    command.put("command", "SendPTT");
    command.put("jid", "[email protected]");
    command.put("data", Base64.getEncoder().encodeToString(StringUtil.ReadFileContent("ptt.ogg")));
                  

SendVcard

    JSONObject command = new JSONObject();
    command.put("task_id", 111);
    command.put("command", "SendVcard");
    command.put("jid", "[email protected]");
    command.put("showname", "abc");
    command.put("vcard", "BEGIN:VCARD\nVERSION:3.0\nN:;;;;\nFN:681330000000\nitem1.TEL:+68 133 000 0000\nitem1.X-ABLabel:xxx\nEND:VCARD");

SendLocation

    JSONObject command = new JSONObject();
    command.put("task_id", 111);
    command.put("command", "SendLocation");
    command.put("jid", "sendvcard");
    command.put("latitude", 98.032313465);
    command.put("longitude", 10.202121212);
    command.put("name", "xx");
    command.put("address", "xx");
    command.put("comment", "xx");

Subscribe

    JSONObject command = new JSONObject();
    command.put("command", "Subscribe");
    command.put("jid", "xxx");

License:

Gorgeous is licensed under the GPLv3+: http://www.gnu.org/licenses/gpl-3.0.html.

gorgeous-whatsapp's People

Contributors

lovethiscode avatar wewewe avatar

Forkers

archean

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.