Bot Detection API

Base URL

API

URLRequest methodContent-TypeOutput formatCharacter set
api-base-url?partner_code=xxx&partner_key=xxxPOSTapplication/jsonJSONUTF-8

Authentication

FieldTypeMeaningRequired fieldsRemarks
partner_codeStringPartner identifyYesProvided by TD
partner_keyStringPartner secret keyYesProvided by TD

Request

FieldMeaningRequired fieldsRemarks
pathInterface pathYes/path/goods/getValuequery
signThe signature returned by the SDKYes
queryQuery parametersNoFormatting reference: {"key1":"asas", "key2":"2"}
bodyRequest messageNoFormatting reference: asdfga

Example Request

Taking the China region site as an example:

curl --location 'https://sg.apitd.net/signature/v2?partner_code=demo&partner_key=xxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
    "path": "p",
    "sign": "g91b0e2ce42957a4b9d2d6b78b63f6fbf31df1117ecee4a96872757c51595d53674ed72ea7df1e1cead879e407021b29e4204cf7e755174e4ab1f4e35d9abb4400000000000022016906d21a40a80cb9a194950000"
}'

Response

FieldTypeMeaningRemarks
codeIntegernterface response status codesRefer to the status code description
messageStringStatus Info
dataJsonVerification resultsPlease refer to the following explanation of the verification result

Status Code

Status CodeReason
200Request successful
431Partner missing
500Internal server error
512This service has not been purchased
513Traffic has been disabled

Verification Result

FieldTypeMeaningRemarks
statusIntegerVerification result codeRefer to the signature verification result code below
envArrayDevice riskroot: privilege escalation behavior
hack: environment attack behavior
virtualEnv: virtual execution
crawler: web crawler
resultStringVerification resultmiss: missing
block: blocked
pass: passed
versionStringVersion number

Verification Result Code

codeResulRemarks
1101missSign missing
1102missPath missing
1200passVerification passed
1301blockInvalid data format
1302blockInvalid data format
1303blockInvalid data format
1304blockInvalid data format
1401blockVerification failed
1402blockVerification failed
1501blockVerification failed
1502blockVerification failed
1503blockVerification failed
1601passVerification passed, but a device risk was detected
1602passVerification passed, but requests kept coming in
1603passVerification passed, requesting replay

Successful Examples

{
  "code": 200,
  "message":"success",
  "data": {
    "status":1200,
    "env": [],
    "result": "pass",
    "version": "v2"
  }
}

Failure Example

{
    "code": 512,
    "message": "This service is not purchased"
}