GithubHelp home page GithubHelp logo

harmonyzhang / whatsapp-business-java-sdk Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 5.0 1.91 MB

Whatsapp business api SDK, written in java. This SDK implements the Official Whatsapp Cloud API and WhatsApp Business Management API and Engagelab Whatsapp API.

Home Page: https://harmonyzhang.github.io/whatsapp-business-java-sdk/

License: MIT License

Ruby 0.01% Java 99.99%
sdk-whatsapp whatsapp whatsapp-api whatsapp-api-java whatsapp-bot whatsapp-bulk-messages whatsapp-business whatsapp-business-api whatsapp-business-sdk whatsapp-chat

whatsapp-business-java-sdk's People

Contributors

gggmwei avatar harmonyzhang avatar lexiangzhang avatar zhanglexiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

whatsapp-business-java-sdk's Issues

Upload media not work

Hi @harmonyzhang,
First of all, thank you for this repository, is very useful.


I implemented everything easily and now I'm doing the testing phase, a week ago I launched the tests for the uploadMedia and it worked. Today launching a test with the average upload, it failed.
The exception thrown comes from the library

java.lang.NoSuchMethodError: okhttp3.MultipartBody.create([BLokhttp3/MediaType;)Lokhttp3/RequestBody; at com.whatsapp.api.impl.WhatsappBusinessCloudApi.uploadMedia([WhatsappBusinessCloudApi.java:73]

Go to WhatsappBusinessCloudApi.uploadMedia

  public UploadResponse uploadMedia(String phoneNumberId, String fileName, FileType fileType, byte[] file) {

        RequestBody requestFile = MultipartBody.create(file, MediaType.parse(fileType.getType()));

           .......
    }

From the source code I see that there is no method with this signature:
MultipartBody.create(byte[] file, MediaType fileType);


There is a method that has this signature and I think you need to change this line so as not to throw this exception.

code

For the solution I think it would be enough just to reverse the parameters passed to the method.

I hope you find this observation useful, I remain available for clarification .. Thank you! ๐Ÿ˜‰

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.