Add an Attempt Control Rule
Add an attempt control rule.
Request URL
POST {base_url}/{api_path}/attempt_controls/create?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| name | Yes | String | The name of the rule. Maximum length: 127 characters. The name must be unique. |
| max_attempts_contact | Yes | Integer | The maximum number of attempts for a single contact. Valid values: 1 to 99. |
| max_attempts_number | Yes | Integer | The maximum number of attempts for a single number. Valid values: 1 to 99. |
| reset_period | Yes | String | The type of reset period. Valid value:
|
| reset_hour | No | Integer | The custom reset interval in hours. Valid values: 1 to 999. Note: This field is required when reset_period is
custom. |
| phonebook_ids | No | String | The unique ID(s) of phonebooks. Each phonebook can be bound to only one
rule. Note:
|
Response parameters
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
Note: You can check the error code and
error message in Error Code and Error Message.
|
| errmsg | String | Returned message.
|
| id | Integer | The unique ID of the newly created attempt control rule. |
Example
Request example
POST /openapi/v1.0/attempt_controls/create?access_token=xVx9wX2B38gSD0C2o4y9b9bd5QOPz2MK HTTP/1.1
Host: 192.168.5.150:8088
Content-Type: application/json
{
"name": "API Test Attempt Rule",
"max_attempts_contact": 5,
"max_attempts_number": 3,
"reset_period": "day"
}
Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"id": 1
}