Putuskan koneksi perangkat

Endpoint API

URL: https://api.wavave.com/v1/device/disconnect

Method: POST

Contoh Kode

<?php
header('Content-Type: application/json; charset=utf-8');

// API Key
$ApiKey = "API_KEY_ANDA_DISINI";

$data = json_encode([
    'device' => '628123456789' 
]);

// Endpoint API
$endpoint = 'https://api.wavave.com/v1/device/disconnect';

$ch = curl_init($endpoint);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    "Authorization: Bearer $ApiKey"
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = curl_error($ch);
curl_close($ch);

if ($response === false) {
    echo json_encode([
        'success' => false,
        'message' => 'cURL error: ' . $error,
        'status_code' => 500
    ]);
    exit;
}

http_response_code($httpCode);
echo $response;

                        

const axios = require('axios');

const ApiKey = "API_KEY_ANDA_DISINI";
const endpoint = "https://api.wavave.com/v1/device/disconnect";

const data = {
    device: "628123456789"
};

axios.post(endpoint, data, {
    headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${ApiKey}`
    }
}).then(response => {
    console.log(response.data);
}).catch(error => {
    console.error({
        success: false,
        message: error.response ? error.response.data : error.message,
        status_code: error.response ? error.response.status : 500
    });
});

                        

import requests

ApiKey = "API_KEY_ANDA_DISINI"
endpoint = "https://api.wavave.com/v1/device/disconnect"

data = {
    "device": "628123456789"
}

headers = {
    "Content-Type": "application/json",
    "Authorization": f"Bearer {ApiKey}"
}

try:
    response = requests.post(endpoint, json=data, headers=headers)
    response.raise_for_status()
    print(response.json())
except requests.exceptions.RequestException as e:
    print({
        "success": False,
        "message": str(e),
        "status_code": response.status_code if 'response' in locals() else 500
    })

                        

curl -X POST "https://api.wavave.com/v1/device/disconnect" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer API_KEY_ANDA_DISINI" \
     -d '{
           "device": "628123456789"
         }'

                        

Parameter

Parameter Tipe Deskripsi
device Number Akun whatsapp yang ingin anda putuskan koneksinya menjadi disconnect.
Catatan Tambahan

Jika anda memutuskan koneksi perangkat melalui API, itu juga akan menghapus histori pesan, autoreply, daftar list kontak dan tidak bisa dikembalikan.

Response Success


{
    "success": true,
    "message": "Disconnect",
    "data": {
        "status": "success",
        "code": 200
    }
}