تسجيل حدث السرعة
curl --request POST \
--url https://api.truthlocks.com/v1/risk/velocity/record \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"action_type": "<string>",
"subject_id": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({action_type: '<string>', subject_id: '<string>'})
};
fetch('https://api.truthlocks.com/v1/risk/velocity/record', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/risk/velocity/record"
payload = {
"action_type": "<string>",
"subject_id": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/risk/velocity/record"
payload := strings.NewReader("{\n \"action_type\": \"<string>\",\n \"subject_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"event_id": "<string>",
"current_count": 123,
"window": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}تسجيل السرعة
تسجيل إجراء السرعة
سجل إجراء موضوع وقم بتقييمه مقابل تسجيل الشذوذ القائم على السرعة. يقوم تلقائيًا باستيعاب إشارة مخاطر عندما تصل درجة السرعة إلى 60 أو أعلى.
POST
/
v1
/
risk
/
velocity
/
record
تسجيل حدث السرعة
curl --request POST \
--url https://api.truthlocks.com/v1/risk/velocity/record \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"action_type": "<string>",
"subject_id": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({action_type: '<string>', subject_id: '<string>'})
};
fetch('https://api.truthlocks.com/v1/risk/velocity/record', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/risk/velocity/record"
payload = {
"action_type": "<string>",
"subject_id": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/risk/velocity/record"
payload := strings.NewReader("{\n \"action_type\": \"<string>\",\n \"subject_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"event_id": "<string>",
"current_count": 123,
"window": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}يسجل إجراءً لموضوع ويحدث عدادات النوافذ المتغيرة عبر أربع نوافذ زمنية (دقيقة واحدة، 5 دقائق، ساعة واحدة، 24 ساعة). يتم حساب درجة سرعة مرجحة من التعدادات المحدثة. عندما تصل الدرجة إلى 60 أو أعلى، يتم استيعاب إشارة مخاطر مع
signal_type: "velocity" تلقائيًا في خط أنابيب إشارة المخاطر.
راجع دليل تسجيل السرعة والشذوذ لسير العمل الكامل، ونموذج التسجيل، وأنماط التكامل.
أوزان التسجيل
| النافذة | الوزن | الغرض |
|---|---|---|
| 1 دقيقة | 30 | كشف الاندفاع |
| 5 دقائق | 20 | إساءة استخدام مستمرة قصيرة المدى |
| 1 ساعة | 10 | أنماط متوسطة المدى |
| 24 ساعة | 5 | شذوذات مستمرة |
الاستجابة
درجة السرعة الموزونة (0-100). تؤدي الدرجات التي تبلغ 60 أو أعلى إلى استيعاب الإشارة تلقائيًا.
معرف UUID لإشارة المخاطر التي تم استيعابها تلقائيًا (موجود فقط عندما يكون
signal_ingested هو true).
