Last active
March 15, 2020 07:44
-
-
Save meseven/258293e8d425f304343c59214121fc45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OkHttpClient client = new OkHttpClient().newBuilder() | |
.build(); | |
MediaType mediaType = MediaType.parse("text/plain"); | |
RequestBody body = RequestBody.create(mediaType, "{\n\t\"phone_number\": \"RECIPIENT_NUMBER\",\n\t\"message\": \"hello\"\n}"); | |
Request request = new Request.Builder() | |
.url("https://api.wapim.io/api/v1/whatsapp/message/text") | |
.method("POST", body) | |
.addHeader("token", "YOUR_WAPIM_TOKEN") | |
.build(); | |
Response response = client.newCall(request).execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Unirest.setTimeouts(0, 0); | |
HttpResponse<String> response = Unirest.post("https://api.wapim.io/api/v1/whatsapp/message/text";) | |
.header("token", "YOUR_WAPIM_TOKEN") | |
.body("{\n\t\"phone_number\": \"RECIPIENT_NUMBER\",\n\t\"message\": \"hello\"\n}") | |
.asString(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment