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 လေးခုလိုအပ်ပါသည်-
| Field | Type | Description |
|---|---|---|
| url | string | Event များကိုလက်ခံရန် HTTPS endpoint (စတင်ရမည် https://) |
| events | array | လက်ခံရရှိရန် Event အမည်များ၊ ဥပမာ ["HIGH","MEDIUM","VETO"] သို့မဟုတ် ["*"] |
| symbols | array | စစ်ထုတ်ရန် Symbols များ၊ ဥပမာ ["BTC","ETH"] သို့မဟုတ် ["*"] |
| secret | string | သင့်၏ လက်မှတ်ထိုးရန် လျှို့ဝှက်စာ — အနည်းဆုံး အက္ခရာ ၁၆ လုံး။ Hashed အနေဖြင့်သိမ်းဆည်းထားသည်။ လက်မှတ်များအား အတည်ပြုရန် သင့်ဘက်တွင် raw value ကိုသိမ်းထားပါ။ |
Event စစ်ထုတ်မှုများ
ပေးပို့မှုများသည် သင့်မှတ်ပုံတင်ထားသော အမည်နှင့် symbol နှင့်ကိုက်ညီသော events များအတွက် ဖြစ်ပေါ်သည်။ ပုံမှန် event အမည်များမှာ အတည်ပြုမှု confidence buckets — HIGH, MEDIUM, VETO — အပိုဆောင်း generic SIGNAL events. အသုံးပြုပါ ["*"] event အားလုံးသို့မဟုတ် symbol အားလုံးကို လက်ခံရရှိရန်။
ပေးပို့မှုနှင့် Headers
ပေးပို့မှုတစ်ခုစီသည် HTTP POST JSON body နှင့် ဤ headers များဖြင့်-
| Header | Value |
|---|---|
| X-SmartMoney-Event | အဖြစ်အပျက်အမည် (ဥပမာ။ HIGH) |
| X-SmartMoney-Signature | HMAC-SHA256 hex digest of the request body (see below) |
| Content-Type | application/json |
| User-Agent | SmartMoneyAPI-Webhook/1.0 |
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.
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