Webhook အကောင်အထည်ဖော်မှု လမ်းညွှန်

HTTPS URL တစ်ခုအား မှတ်ပုံတင်ပြီး smart-money အချက်ပြမှုများ ဖြစ်ပေါ်သည့်အခါ real-time, HMAC-signed event pushes များကို လက်ခံရယူပါ — polling မလိုအပ်ပါ။ ဤလမ်းညွှန်တွင် မှတ်ပုံတင်ခြင်း၊ event စစ်ထုတ်ခြင်း၊ လက်မှတ်အတည်ပြုခြင်းနှင့် ပြန်လည်ကြိုးစားမှုအပြုအမူများပါဝင်သည်။

အခြေခံအကျဉ်း

Polling လုပ်ခြင်းအစား /v1/confirm သို့မဟုတ် အချက်ပြမှုဖီးဒ်ကို၊ webhook တစ်ခုအား မှတ်ပုံတင်ပြီး Smart Money API သည် သင့်၏ endpoint သို့ ကိုက်ညီသောအချက်ပြမှုဖြစ်ပေါ်သည့်အချိန်တွင် event တစ်ခုအား POST လုပ်ပေးမည်။ ပေးပို့မှုတိုင်းကို HMAC-SHA256 ဖြင့် လက်မှတ်ထိုးထားသောကြောင့် ၎င်းသည် ကျွန်ုပ်တို့ထံမှ အမှန်တကယ်လာကြောင်း သင့်အနေဖြင့် အတည်ပြုနိုင်သည်။

Outbound webhooks များကို Pro နှင့် Enterprise အစီအစဉ်များတွင် ရရှိနိုင်ပါသည်။

Webhook တစ်ခုအား မှတ်ပုံတင်ခြင်း

POST လုပ်ရန် /v1/webhooks သင့်၏ API key ကို X-API-Key header တွင်ထည့်ပါ။ Body တွင် field လေးခုလိုအပ်ပါသည်-

FieldTypeDescription
urlstringEvent များကိုလက်ခံရန် HTTPS endpoint (စတင်ရမည် https://)
eventsarrayလက်ခံရရှိရန် Event အမည်များ၊ ဥပမာ ["HIGH","MEDIUM","VETO"] သို့မဟုတ် ["*"]
symbolsarrayစစ်ထုတ်ရန် Symbols များ၊ ဥပမာ ["BTC","ETH"] သို့မဟုတ် ["*"]
secretstringသင့်၏ လက်မှတ်ထိုးရန် လျှို့ဝှက်စာ — အနည်းဆုံး အက္ခရာ ၁၆ လုံး။ Hashed အနေဖြင့်သိမ်းဆည်းထားသည်။ လက်မှတ်များအား အတည်ပြုရန် သင့်ဘက်တွင် raw value ကိုသိမ်းထားပါ။
cURL
curl -X POST https://api.smartmoneyapi.com/v1/webhooks \ -H "X-API-Key: sm_your_key" \ -H "Content-Type: application/json" \ -d '{ "url": "https://yourapp.com/webhooks/smartmoney", "events": ["HIGH", "MEDIUM"], "symbols": ["BTC", "ETH"], "secret": "a-long-random-secret-16-plus-chars" }'
201 Created
{ "webhook_id": 42, "url": "https://yourapp.com/webhooks/smartmoney", "events": ["HIGH", "MEDIUM"], "symbols": ["BTC", "ETH"], "message": "Webhook registered. Test with POST /v1/webhooks/test" }

Event စစ်ထုတ်မှုများ

ပေးပို့မှုများသည် သင့်မှတ်ပုံတင်ထားသော အမည်နှင့် symbol နှင့်ကိုက်ညီသော events များအတွက် ဖြစ်ပေါ်သည်။ ပုံမှန် event အမည်များမှာ အတည်ပြုမှု confidence buckets — HIGH, MEDIUM, VETO — အပိုဆောင်း generic SIGNAL events. အသုံးပြုပါ ["*"] event အားလုံးသို့မဟုတ် symbol အားလုံးကို လက်ခံရရှိရန်။

ပေးပို့မှုနှင့် Headers

ပေးပို့မှုတစ်ခုစီသည် HTTP POST JSON body နှင့် ဤ headers များဖြင့်-

HeaderValue
X-SmartMoney-Eventအဖြစ်အပျက်အမည် (ဥပမာ။ HIGH)
X-SmartMoney-SignatureHMAC-SHA256 hex digest of the request body (see below)
Content-Typeapplication/json
User-AgentSmartMoneyAPI-Webhook/1.0
Example payload
{ "event": "HIGH", "ts": "2026-07-01T18:22:05Z", "symbol": "BTC", "direction": "long", "confidence": "HIGH", "composite": 0.74, "webhook_id": 42 }

Respond with any 2xx status to acknowledge. Non-2xx (or a timeout) triggers a retry.

Verifying Signatures

The signature in X-SmartMoney-Signature is an HMAC-SHA256 hex digest of the request body. The HMAC key is the SHA-256 hex digest of the secret you registered (your raw secret is only ever stored hashed on our side). To verify: derive the key, HMAC the raw body, and compare with a constant-time check. Reject any request that fails.

Python (Flask receiver)
import hashlib, hmac from flask import Flask, request, abort app = Flask(__name__) MY_SECRET = "a-long-random-secret-16-plus-chars" # the value you registered @app.post("/webhooks/smartmoney") def receive(): raw = request.get_data() # exact bytes of the body sig = request.headers.get("X-SmartMoney-Signature", "") key = hashlib.sha256(MY_SECRET.encode()).hexdigest() # HMAC key = sha256(secret) hex expected = hmac.new(key.encode(), raw, hashlib.sha256).hexdigest() if not hmac.compare_digest(expected, sig): abort(401) event = request.get_json() # ... act on event["event"], event["symbol"], event["composite"] ... return "", 200
Node.js (Express receiver)
import crypto from "crypto"; import express from "express"; const app = express(); const MY_SECRET = "a-long-random-secret-16-plus-chars"; // Capture the raw body so the signature check uses the exact bytes. app.post("/webhooks/smartmoney", express.raw({ type: "*/*" }), (req, res) => { const sig = req.get("X-SmartMoney-Signature") || ""; const key = crypto.createHash("sha256").update(MY_SECRET).digest("hex"); const expected = crypto.createHmac("sha256", key).update(req.body).digest("hex"); const ok = expected.length === sig.length && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(sig)); if (!ok) return res.status(401).end(); const event = JSON.parse(req.body.toString()); // ... act on event ... res.status(200).end(); });
Verify against the raw, unparsed request body — re-serializing parsed JSON can change byte order or spacing and break the check.

Retries

If your endpoint does not return a 2xx (သို့မဟုတ် အချိန်ကုန်သွားပါက - ပေးပို့မှုအချိန်အလိုက်သည် 10s ဖြစ်သည်), Smart Money API သည် အဆမတန် backoff (ခန့်မှန်းခြေ 1s, 4s, ပြီးနောက် 16s) ဖြင့် 3 ကြိမ်အထိ ပြန်လည်ကြိုးစားသည်။ သင့် handler ကို idempotent ဖြစ်အောင်ပြုလုပ်ပါ၊ ထို့ကြောင့် ပြန်လည်ပေးပို့ထားသော event ကို နှစ်ကြိမ်လုပ်ဆောင်ရန် ဘေးကင်းသည်။

Inbound Webhooks (TradingView)

သီးသန့်အနေဖြင့်၊ သင်သည် inbound သတိပေးချက်ကို ကျွန်ုပ်တို့ထံသို့ ပေးပို့နိုင်သည်။ POST /v1/tradingview/webhook TradingView သတိပေးချက်ကို လက်ခံရရှိပြီး၊ ၎င်းကို /confirmမှတစ်ဆင့် လုပ်ဆောင်ကာ အတည်ပြုချက်ကို ပြန်ပို့သည်။ TradingView သည် custom headers များကို မပို့နိုင်သောကြောင့်၊ ၎င်းသည် JSON body အတွင်းရှိ secret field ဖြင့် အတည်ပြုသည် ( X-API-Keyမဟုတ်ပါ)။ ပို့ပါ secret, symbol, နှင့် direction (long/short); ရွေးချယ်စရာအနေဖြင့် timeframe, strategy, နှင့် price.

Real-time signals များကို ချိတ်ဆက်ရန် အဆင်သင့်ဖြစ်ပြီလား?

Get your API key
အခမဲ့စတင်ပါ - တစ်နေ့လျှင် 50 ကြိမ်၊ ကဒ်မလိုအပ်ပါ

API တစ်ခုတည်းမှ 3 exchange များအတွက် live whale flow, funding, open interest နှင့် on-chain data များကို ရယူပါ။ အခမဲ့ tier၊ ကဒ်မလိုအပ်ပါ၊ မည်သည့်အချိန်တွင်မဆို အဆင့်မြှင့်နိုင်သည်။

Start free →
Try the live API console → (အကောင့်မလိုအပ်ပါ)
Get your API key in 30 seconds

တည်ဆောက်ရန် အဆင်သင့်ဖြစ်ပြီလား? အခမဲ့ API key (တစ်နေ့လျှင် 50 ကြိမ်၊ ကဒ်မလိုအပ်ပါ) ကိုရယူပြီး live whale, funding နှင့် on-chain data များကို ဆွဲယူရန် စတင်ပါ။

Get your API key →