Common parameters

更新时间:
复制 MD 格式

This topic describes the common request parameters and common response parameters used when you call Risk Identification APIs.

Common request parameters

Risk Identification API requests include both common request parameters, which are required for all API operations, and service-specific event parameters. The following table describes the common request parameters.

Parameter

Type

Required

Description

Format

String

Yes

The format of the response. Valid values:

  • JSON (default)

  • XML

Version

String

Yes

The API version. The value must be in the YYYY-MM-DD format. The current version is 2019-05-21.

AccessKeyId

String

Yes

The access key ID that Alibaba Cloud provides for you to access the service.

Signature

String

Yes

The signature string. For more information about calculating the signature, see Section 2.0 in Call with an SDK.

SignatureMethod

String

Yes

The signature method. Only HMAC-SHA1 is supported.

Timestamp

String

Yes

The request timestamp, which must be in ISO 8601 format and UTC. The format is yyyy-MM-ddTHH:mm:ssZ. For example, 09:44:35 on August 22, 2019 (Beijing time) is represented as 2019-08-22T01:44:35Z.

SignatureVersion

String

Yes

The version of the signature algorithm. Set the value to 1.0.

SignatureNonce

String

Yes

A unique random number to prevent replay attacks. You must use a different value for each request.

Action

String

Yes

The value must be ExecuteRequest.

Service

String

Yes

The service code provided by Alibaba Cloud Security. Do not customize this value. The following list describes the service codes:

  • Social LLM-based Fraud Detection: llm_fraud_detection

  • Enhanced Registration Risk Identification: account_abuse_pro

  • Register Fraud Detection Service: account_abuse

  • Enhanced Marketing Risk Identification: coupon_abuse_pro

  • Advertise Fraud Detection Service: coupon_abuse

  • Enhanced Logon Risk Identification: account_takeover_pro

  • Log on to Fraud Detection Service: account_takeover

  • Ad Fraud Detection: ad_fraud_detection

  • Enhanced Ad Fraud Detection: ad_fraud_detection_pro

  • Device Fraud Detection: device_risk

  • Device Fraud Detection - Enhanced Edition: device_risk_pro

  • Risk Intelligence: risk_intelligence

  • Email Risk: email_risk

  • Address Validation: address_validation

  • IP Risk Intelligence: risk_intelligence_ip

ServiceParameters

String

Yes

The service-specific event parameters in JSON format. Example: {"accountId":10123**** ...other request parameters for this event}. Refer to the following topics for the parameters of each service: 

The following example shows a request for the Enhanced Registration Risk Identification service:

    https://saf.cn-shanghai.aliyuncs.com/
    ?Format=JSON
    &Version=2019-05-21
    &Signature=vpEEL0zFHfxXYzSFV0n7%2FZiFL9o%3D 
    &SignatureMethod=Hmac-SHA1
    &SignatureNonce=15215528852396
    &SignatureVersion=1.0
    &Action=ExecuteRequest
    &AccessKeyId=123****saf 
    &Timestamp=2018-06-01T12:00:00Z
    &Service=account_abuse_pro
    &ServiceParameters={"accountId":1012**** ...other event-specific parameters. See service documentation for details.}
                

Common response parameters

Every API request returns a unique identifier, RequestId, regardless of whether the call is successful. Other response parameters, such as score, tags, and extend, vary by service. For more information, see the documentation for the specific service.

The following example shows a JSON response for the Enhanced Registration Risk Identification service:

{
    //service: account_abuse_pro

    "Data": {
        "score": 85.92, // Risk score. The value is a double that ranges from 0 to 100.
        "tags": "rm0101" // Risk tag. The value is a string.
    },
    "Message": "OK",
    "Code": 200, // A value of 200 indicates that the request was successful.
    "RequestId": "4EF9AEE5-288F-4176-8110-00EDC91A614E"
}              
Note

The sample responses in this topic are formatted for readability. The actual responses do not include line breaks or indentation.

The following example shows a JSON response for the Email Risk service:

{
    "Data": {
        "tags": "temp_email,gibberish_email" // String format.
    },
    "Message": "OK",
    "Code": 200, // A value of 200 indicates that the request was successful.
    "RequestId": "4EF9AEE5-288F-4176-8110-00EDC91A614E"
}    

Error codes

Code

Description

200

The request was successful.

400

The ServiceParameters (event parameters) are invalid.

402

The number of queries per second (QPS) exceeds the configured limit, triggering throttling.

403

Permission denied. The service may not be activated or could have expired.

404

The Service parameter is invalid.

500

An internal server error occurred.