const axios = require('axios');

async function test() {
    try {
        console.log("Testing POST /api/send...");
        const res = await axios.post('http://127.0.0.1:3000/api/send', {
            messageType: 'text',
            to: '081234567890',
            body: 'Hello from Test Script'
        }, {
            headers: { 'Authorization': 'rahasia123' } // Matching docker-compose API_KEY
        });
        console.log("Response:", JSON.stringify(res.data, null, 2));
    } catch (e) {
        console.error("Error:", e.message);
        if (e.response) console.error("Data:", e.response.data);
    }
}

test();
