Authentication Required
{{ authError }}
No Webhook Subscribers Found
{{ subSearch ? 'No subscribers match your search filter.' : 'Register webhook endpoints to receive automated data broadcasts.' }}
| ID | Name / Label | Webhook Endpoint | Status | Created At | Actions |
|---|---|---|---|---|---|
| #{{ sub.id }} | {{ sub.name || 'Untitled Webhook' }} |
{{ sub.endpoint }}
|
{{ sub.active ? 'Active' : 'Inactive' }} | {{ formatDate(sub.created_at) }} |
|
payloads table.
No Payloads Ingested Yet
Use the Ingest Test Tool or send a GET /send request to ingest data.
{{ p.source }}
{{ formatDate(p.created_at) }}
Simulate Ingestion Endpoint (GET /send)
Test ingesting JSON payloads into the database layer per the PRD specification.
GET /send?payload=...&source=...
Maiki Gateway Integration Guide
Gunakan panduan ini untuk mengintegrasikan website atau sistem Anda dengan Maiki API Gateway. Semua interaksi diamankan dengan Bearer API Key yang divalidasi dengan hash SHA-256 di basis data MySQL.
{{ apiBaseUrl }}
đ 1. Alur Integrasi Cepat (Quickstart)
Buat API Key
Generate Master API Key di server via ./scripts/create_api_key.sh.
Daftarkan Webhook
Kirim POST /subscribe berisi endpoint URL yang akan menerima data.
Kirim & Broadcast
Kirim payload via GET /send atau notifikasi langsung via POST /notify.
đģ 2. Contoh Kode Request API
curl -X POST "{{ apiBaseUrl }}/subscribe" \
-H "Authorization: Bearer {{ apiKey || 'sk_live_...' }}" \
-H "Content-Type: application/json" \
-d '{
"endpoint": "https://myapp.com/webhook",
"name": "Production Webhook"
}'
curl -X POST "{{ apiBaseUrl }}/notify" \
-H "Authorization: Bearer {{ apiKey || 'sk_live_...' }}" \
-H "Content-Type: application/json" \
-d '{
"endpoint": "https://specific-app.com/webhook",
"payload": {
"event": "invoice.paid",
"amount": 500000,
"currency": "IDR"
}
}'
# 1. Simpan payload ke DB (GET /send)
curl -X GET "{{ apiBaseUrl }}/send?payload=%7B%22event%22%3A%22user.signup%22%2C%22email%22%3A%22user%40test.com%22%7D&source=myapp" \
-H "Authorization: Bearer {{ apiKey || 'sk_live_...' }}"
# 2. Kirim ke semua subscriber aktif (POST /broadcast)
curl -X POST "{{ apiBaseUrl }}/broadcast" \
-H "Authorization: Bearer {{ apiKey || 'sk_live_...' }}"
đĄ 3. Cara Menerima Webhook di Sisi Server (PHP / Node.js)
<?php
header('Content-Type: application/json');
$input = file_get_contents('php://input');
$data = json_decode($input, true);
$payloadId = $data['payload_id'] ?? null;
$eventData = $data['data'] ?? [];
// Logika aplikasi...
error_log("Diterima webhook #$payloadId: " . json_encode($eventData));
http_response_code(200);
echo json_encode(['status' => 'received']);
?>
const express = require('express');
const app = express();
app.use(express.json());
app.post('/webhook', (req, res) => {
const { payload_id, source, data } = req.body;
console.log(`Diterima webhook #${payload_id}:`, data);
res.status(200).json({ status: 'received' });
});
app.listen(3000);
đ 4. Tabel Referensi Endpoint Lengkap
| Endpoint | Method | Auth | Deskripsi |
|---|---|---|---|
| /health | GET | Publik | Cek ketersediaan dan latensi gateway. |
| /send?payload={JSON} | GET | Bearer Key | Ingest payload JSON ke database MySQL. |
| /subscribe | POST | Bearer Key | Daftarkan endpoint webhook baru. |
| /subscribers | GET | Bearer Key | Ambil daftar seluruh webhook subscriber. |
| /unsubscribe | POST | Bearer Key | Nonaktifkan subscriber webhook. |
| /broadcast | POST | Bearer Key | Kirim broadcast asinkron ke semua webhook aktif. |
| /notify | POST | Bearer Key | Kirim notifikasi langsung ke 1 receiver spesifik. |
| /payloads | GET | Bearer Key | Ambil log 50 data payload terakhir. |