Blazwa v1.0.0
Selamat data di API Blazwa v1.0.0. Kamu dapat menggunakan akses Open API kami, dimana kamu dapat mengirim pesan, image, set webhook, dan lain lain. Kami telah menyiapkan beberapa contoh code dalam beberapa bahasa, kamu dapat melihat nya di tab sebelah kanan, dan kamu dapat mengubah bahasa nya di tab kanan atas. Kamu bisa mendapatkan api key dan license dengan daftar terlebih dahulu pada halaman register.
Terima kasih telah menggunakan layanan kami.
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Introduction
Selamat data di API Blazwa v1.0.0. Kamu dapat menggunakan akses Open API kami, dimana kamu dapat mengirim pesan, image, set webhook, dan lain lain. Kami telah menyiapkan beberapa contoh code dalam beberapa bahasa, kamu dapat melihat nya di tab sebelah kanan, dan kamu dapat mengubah bahasa nya di tab kanan atas. Kamu bisa mendapatkan api key dan license dengan daftar terlebih dahulu pada halaman register.
Terima kasih telah menggunakan layanan kami.
Base URLs:
Authentication
- API Key (Token)
- Parameter Name: X-API-KEY, in: header. You can get API key from dashboard
API
All of open api endpoint
Restart Service [Production only]
Code samples
# You can also use wget
curl -X GET https://openapi.blazwa.com/openapi/wa/restart \
-H 'Accept: application/json' \
-H 'X-API-KEY: API_KEY'
GET https://openapi.blazwa.com/openapi/wa/restart HTTP/1.1
Host: wa.kpntr.com
Accept: application/json
const headers = {
'Accept':'application/json',
'X-API-KEY':'API_KEY'
};
fetch('https://openapi.blazwa.com/openapi/wa/restart',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-KEY' => 'API_KEY'
}
result = RestClient.get 'https://openapi.blazwa.com/openapi/wa/restart',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-API-KEY': 'API_KEY'
}
r = requests.get('https://openapi.blazwa.com/openapi/wa/restart', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-KEY' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://openapi.blazwa.com/openapi/wa/restart', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://openapi.blazwa.com/openapi/wa/restart");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-KEY": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://openapi.blazwa.com/openapi/wa/restart", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /openapi/wa/restart
Restart service
Restart specified service with license
Example responses
200 Response
{
"message": "string",
"status": "qr",
"code": null
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | Error | default-400-schema |
| 401 | Unauthorized | Unauthorized | default-401-schema |
| 500 | Internal Server Error | Internal server error | default-500-schema |
| 504 | Gateway Time-out | Timeout | default-504-schema |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | true | none | none |
| » status | string | true | none | none |
| » code | any | true | none | none |
Enumerated Values
| Property | Value |
|---|---|
| status | qr |
| status | ready |
Check Service Status
Code samples
# You can also use wget
curl -X POST https://openapi.blazwa.com/openapi/wa/status \
-H 'Accept: application/json' \
-H 'X-API-KEY: API_KEY'
POST https://openapi.blazwa.com/openapi/wa/status HTTP/1.1
Host: wa.kpntr.com
Accept: application/json
const headers = {
'Accept':'application/json',
'X-API-KEY':'API_KEY'
};
fetch('https://openapi.blazwa.com/openapi/wa/status',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-KEY' => 'API_KEY'
}
result = RestClient.post 'https://openapi.blazwa.com/openapi/wa/status',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-API-KEY': 'API_KEY'
}
r = requests.post('https://openapi.blazwa.com/openapi/wa/status', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-KEY' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://openapi.blazwa.com/openapi/wa/status', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://openapi.blazwa.com/openapi/wa/status");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-KEY": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://openapi.blazwa.com/openapi/wa/status", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /openapi/wa/status
Check status
Check status service by license.
Example responses
200 Response
{
"message": "string",
"status": "qr",
"code": null
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | Error | default-400-schema |
| 401 | Unauthorized | Unauthorized | default-401-schema |
| 500 | Internal Server Error | Internal server error | default-500-schema |
| 504 | Gateway Time-out | Timeout | default-504-schema |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | true | none | none |
| » status | string | true | none | none |
| » code | any | true | none | none |
Enumerated Values
| Property | Value |
|---|---|
| status | qr |
| status | connected |
Scan QR [Production only]
Code samples
# You can also use wget
curl -X POST https://openapi.blazwa.com/openapi/wa/login-qr \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'X-API-KEY: API_KEY'
POST https://openapi.blazwa.com/openapi/wa/login-qr HTTP/1.1
Host: wa.kpntr.com
Content-Type: application/x-www-form-urlencoded
Accept: application/json
const inputBody = '{
"responseAs": "image"
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'X-API-KEY':'API_KEY'
};
fetch('https://openapi.blazwa.com/openapi/wa/login-qr',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json',
'X-API-KEY' => 'API_KEY'
}
result = RestClient.post 'https://openapi.blazwa.com/openapi/wa/login-qr',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json',
'X-API-KEY': 'API_KEY'
}
r = requests.post('https://openapi.blazwa.com/openapi/wa/login-qr', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json',
'X-API-KEY' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://openapi.blazwa.com/openapi/wa/login-qr', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://openapi.blazwa.com/openapi/wa/login-qr");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/x-www-form-urlencoded"},
"Accept": []string{"application/json"},
"X-API-KEY": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://openapi.blazwa.com/openapi/wa/login-qr", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /openapi/wa/login-qr
Scan QR
Scan QR code to login whatsapp
Body parameter
responseAs: image
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | false | none |
| » responseAs | body | string | false | You can specify choice return as image or string base64 |
Enumerated Values
| Parameter | Value |
|---|---|
| » responseAs | image |
| » responseAs | string |
Example responses
200 Response
{
"message": "string",
"qr_string": "string",
"code": null
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | Error | default-400-schema |
| 401 | Unauthorized | Unauthorized | default-401-schema |
| 500 | Internal Server Error | Internal server error | default-500-schema |
| 504 | Gateway Time-out | Timeout | default-504-schema |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | true | none | none |
| » qr_string | string | true | none | none |
| » code | any | true | none | none |
Check Phone Number [Production only]
Code samples
# You can also use wget
curl -X GET https://openapi.blazwa.com/openapi/wa/check-number/{phoneNumber} \
-H 'Accept: application/json' \
-H 'X-API-KEY: API_KEY'
GET https://openapi.blazwa.com/openapi/wa/check-number/{phoneNumber} HTTP/1.1
Host: wa.kpntr.com
Accept: application/json
const headers = {
'Accept':'application/json',
'X-API-KEY':'API_KEY'
};
fetch('https://openapi.blazwa.com/openapi/wa/check-number/{phoneNumber}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-KEY' => 'API_KEY'
}
result = RestClient.get 'https://openapi.blazwa.com/openapi/wa/check-number/{phoneNumber}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-API-KEY': 'API_KEY'
}
r = requests.get('https://openapi.blazwa.com/openapi/wa/check-number/{phoneNumber}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-KEY' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://openapi.blazwa.com/openapi/wa/check-number/{phoneNumber}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://openapi.blazwa.com/openapi/wa/check-number/{phoneNumber}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-KEY": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://openapi.blazwa.com/openapi/wa/check-number/{phoneNumber}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /openapi/wa/check-number/{phoneNumber}
Check number
Check number whatsapp is available to send message
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| phoneNumber | path | string | true | Menghapus semua karakter selain angka. Lalu, jika diawali 0, maka angka 0 tersebut diganti dengan 62 |
Detailed descriptions
phoneNumber: Menghapus semua karakter selain angka. Lalu, jika diawali 0, maka angka 0 tersebut diganti dengan 62
Examples :
| Input | Read as |
| --- | --- |
| 081234567890, 0812 3456 7890, 0812-3456-7890, 6281234567890, 62812 3456 7890 | 6281234567890 |
| 81234567890, 812 3456 7890, 812-3456-7890 | 81234567890 |
Example responses
200 Response
{
"message": "string",
"is_registered": true,
"code": null
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | Error | default-400-schema |
| 401 | Unauthorized | Unauthorized | default-401-schema |
| 500 | Internal Server Error | Internal server error | default-500-schema |
| 504 | Gateway Time-out | Timeout | default-504-schema |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | true | none | none |
| » is_registered | boolean | true | none | none |
| » code | any | true | none | none |
Send Message
Code samples
# You can also use wget
curl -X POST https://openapi.blazwa.com/openapi/wa/message \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'X-API-KEY: API_KEY'
POST https://openapi.blazwa.com/openapi/wa/message HTTP/1.1
Host: wa.kpntr.com
Content-Type: application/x-www-form-urlencoded
Accept: application/json
const inputBody = '{
"phoneNumber": "string",
"message": "string",
"imageUrl": "string"
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'X-API-KEY':'API_KEY'
};
fetch('https://openapi.blazwa.com/openapi/wa/message',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json',
'X-API-KEY' => 'API_KEY'
}
result = RestClient.post 'https://openapi.blazwa.com/openapi/wa/message',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json',
'X-API-KEY': 'API_KEY'
}
r = requests.post('https://openapi.blazwa.com/openapi/wa/message', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json',
'X-API-KEY' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://openapi.blazwa.com/openapi/wa/message', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://openapi.blazwa.com/openapi/wa/message");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/x-www-form-urlencoded"},
"Accept": []string{"application/json"},
"X-API-KEY": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://openapi.blazwa.com/openapi/wa/message", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /openapi/wa/message
Send message
Send message to some number
Body parameter
phoneNumber: string
message: string
imageUrl: string
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » phoneNumber | body | string | true | Menghapus semua karakter selain angka. Lalu, jika diawali 0, maka angka 0 tersebut diganti dengan 62 |
| » message | body | string | false | none |
| » imageUrl | body | string | false | You can add an image URL and make sure your image is not transparent |
Detailed descriptions
» phoneNumber: Menghapus semua karakter selain angka. Lalu, jika diawali 0, maka angka 0 tersebut diganti dengan 62
Examples :
| Input | Read as |
| --- | --- |
| 081234567890, 0812 3456 7890, 0812-3456-7890, 6281234567890, 62812 3456 7890 | 6281234567890 |
| 81234567890, 812 3456 7890, 812-3456-7890 | 81234567890 |
Example responses
200 Response
{
"message": "string",
"result": {
"id": "string",
"body": "string",
"from": "string",
"to": "string",
"media_url": "string",
"created_at": "string"
},
"code": null
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | code possible value: | |
| - 20001 | Inline | ||
| 400 | Bad Request | Error | default-400-schema |
| 401 | Unauthorized | Unauthorized | default-401-schema |
| 500 | Internal Server Error | Internal server error | default-500-schema |
| 504 | Gateway Time-out | Timeout | default-504-schema |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | true | none | none |
| » result | object | true | none | none |
| »» id | string | true | none | none |
| »» body | string | true | none | none |
| »» from | string | true | none | none |
| »» to | string | true | none | none |
| »» media_url | string¦null | true | none | none |
| »» created_at | string | true | none | format "YYYY-MM-DD HH:mm:ss" |
| » code | any | true | none | none |
Send Message to Group
Code samples
# You can also use wget
curl -X POST https://openapi.blazwa.com/openapi/wa/message-group \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'X-API-KEY: API_KEY'
POST https://openapi.blazwa.com/openapi/wa/message-group HTTP/1.1
Host: wa.kpntr.com
Content-Type: application/x-www-form-urlencoded
Accept: application/json
const inputBody = '{
"groupName": "string",
"message": "string",
"imageUrl": "string"
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'X-API-KEY':'API_KEY'
};
fetch('https://openapi.blazwa.com/openapi/wa/message-group',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json',
'X-API-KEY' => 'API_KEY'
}
result = RestClient.post 'https://openapi.blazwa.com/openapi/wa/message-group',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json',
'X-API-KEY': 'API_KEY'
}
r = requests.post('https://openapi.blazwa.com/openapi/wa/message-group', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json',
'X-API-KEY' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://openapi.blazwa.com/openapi/wa/message-group', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://openapi.blazwa.com/openapi/wa/message-group");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/x-www-form-urlencoded"},
"Accept": []string{"application/json"},
"X-API-KEY": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://openapi.blazwa.com/openapi/wa/message-group", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /openapi/wa/message-group
Body parameter
groupName: string
message: string
imageUrl: string
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » groupName | body | string | true | must exist |
| » message | body | string | false | must exist if imageUrl doesnt exist |
| » imageUrl | body | string | false | none |
Example responses
200 Response
{
"message": "string",
"result": {
"id": "string",
"body": "string",
"from": "string",
"to": "string",
"media_url": "string",
"created_at": "string"
},
"code": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | code possible value: | |
| - 20001 | Inline | ||
| 400 | Bad Request | Error | default-400-schema |
| 401 | Unauthorized | Unauthorized | default-401-schema |
| 500 | Internal Server Error | Internal server error | default-500-schema |
| 504 | Gateway Time-out | Timeout | default-504-schema |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | true | none | none |
| » result | object | true | none | none |
| »» id | string | true | none | none |
| »» body | string | true | none | none |
| »» from | string | true | none | none |
| »» to | string | true | none | none |
| »» media_url | string¦null | true | none | none |
| »» created_at | string | true | none | format "YYYY-MM-DD HH:mm:ss" |
| » code | any | true | none | none |
Status Code 401
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | true | none | none |
Status Code 504
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | true | none | none |
Webhook [Production only]
Code samples
# You can also use wget
curl -X POST https://openapi.blazwa.com/openapi/wa/webhook \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'X-API-KEY: API_KEY'
POST https://openapi.blazwa.com/openapi/wa/webhook HTTP/1.1
Host: wa.kpntr.com
Content-Type: application/x-www-form-urlencoded
Accept: application/json
const inputBody = '{
"webhook": "string"
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'X-API-KEY':'API_KEY'
};
fetch('https://openapi.blazwa.com/openapi/wa/webhook',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json',
'X-API-KEY' => 'API_KEY'
}
result = RestClient.post 'https://openapi.blazwa.com/openapi/wa/webhook',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json',
'X-API-KEY': 'API_KEY'
}
r = requests.post('https://openapi.blazwa.com/openapi/wa/webhook', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json',
'X-API-KEY' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://openapi.blazwa.com/openapi/wa/webhook', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://openapi.blazwa.com/openapi/wa/webhook");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/x-www-form-urlencoded"},
"Accept": []string{"application/json"},
"X-API-KEY": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://openapi.blazwa.com/openapi/wa/webhook", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /openapi/wa/webhook
Menambahkan link webhook pada table license
Body parameter
webhook: string
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » webhook | body | string | true | url webhook |
Example responses
200 Response
{
"message": "string",
"code": 0
}
Webhook Response
{
"message": "lorem ipsum dolor sit amet",
"from": "6281234567890"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | code possible value: | |
| - 20001 | Inline | ||
| 400 | Bad Request | Error | default-400-schema |
| 401 | Unauthorized | Unauthorized | default-401-schema |
| 500 | Internal Server Error | Internal server error | default-500-schema |
| 504 | Gateway Time-out | Timeout | default-504-schema |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | true | none | none |
| » code | integer | true | none | none |
Status Code 401
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | true | none | none |
Reset Webhook [Production only]
Code samples
# You can also use wget
curl -X GET https://openapi.blazwa.com/openapi/wa/webhook/reset \
-H 'Accept: application/json' \
-H 'X-API-KEY: API_KEY'
GET https://openapi.blazwa.com/openapi/wa/webhook/reset HTTP/1.1
Host: wa.kpntr.com
Accept: application/json
const headers = {
'Accept':'application/json',
'X-API-KEY':'API_KEY'
};
fetch('https://openapi.blazwa.com/openapi/wa/webhook/reset',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-KEY' => 'API_KEY'
}
result = RestClient.get 'https://openapi.blazwa.com/openapi/wa/webhook/reset',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-API-KEY': 'API_KEY'
}
r = requests.get('https://openapi.blazwa.com/openapi/wa/webhook/reset', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-KEY' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://openapi.blazwa.com/openapi/wa/webhook/reset', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("https://openapi.blazwa.com/openapi/wa/webhook/reset");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-KEY": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://openapi.blazwa.com/openapi/wa/webhook/reset", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /openapi/wa/webhook/reset
Example responses
200 Response
{
"message": "string",
"status": "qr",
"code": 0
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | Error | default-400-schema |
| 401 | Unauthorized | Unauthorized | default-401-schema |
| 500 | Internal Server Error | Internal server error | default-500-schema |
| 504 | Gateway Time-out | Timeout | default-504-schema |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | true | none | none |
| » status | string | true | none | none |
| » code | code-schema | true | none | none |
Enumerated Values
| Property | Value |
|---|---|
| status | qr |
| status | connected |
Status Code 401
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | true | none | none |
Status Code 504
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | true | none | none |
Schemas
default-400-schema
{
"message": "string",
"errors": [
"string"
],
"code": null
}
Properties
oneOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » message | string | true | none | none |
| » errors | [string] | true | none | none |
| » code | code-schema | true | none | none |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » message | string | true | none | none |
| » code | code-schema | true | none | none |
default-401-schema
{
"message": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| message | string | true | none | none |
default-500-schema
{
"message": "string",
"error": "string",
"code": null
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| message | string | true | none | none |
| error | string | true | none | none |
| code | code-schema | true | none | none |
default-504-schema
{
"message": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| message | string | true | none | none |