Search Attempt Control Rules

Search attempt control rules by name.

Request URL

GET {base_url}/{api_path}/attempt_controls/search?access_token={access_token}

Request parameters

Parameter Required Type Description
page No Integer Define which page is displayed.
page_size No Integer Define how many records per page.
search_value No String The search keyword, fuzzy-matched against the name of attempt control rules. If omitted or empty, all rules are returned. Maximum length: 127 characters.
sort_by No String Define the sorting field.

Valid value:

  • id: Sort by ID.
  • name: Sort by name.
order_by No String Define the display order.

Valid value:

  • desc: Descending order.
  • asc: Ascending order.

Response parameters

Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
data Array<Attempt_Control> The list of attempt control rules on the current page.
total_number Integer The total number of attempt control rules.
Attempt_Control
Parameter Type Description
id Integer The unique ID of the rule.
name String The name of the rule. Maximum length: 127 characters. The name must be unique.
reset_period String The type of reset period.
  • day: The attempt counters reset every day.
  • month: The attempt counters reset every month.
  • custom: The attempt counters reset at the custom interval specified by reset_hour.
  • never: The attempt counters never reset.
reset_hour Integer The custom reset interval in hours. Valid values: 1 to 999.
Note: This field is required when reset_period is custom.
max_attempts_contact Integer The maximum number of attempts for a single contact. Valid values: 1 to 99.
max_attempts_number Integer The maximum number of attempts for a single number. Valid values: 1 to 99.
phonebook_ids String The unique ID(s) of phonebooks. One phonebook can be bound to only one rule; set the value to empty to clear the binding.
Note:

Example

Request example

GET /openapi/v1.0/attempt_controls/search?search_value=API&page=1&page_size=2&access_token=xVx9wX2B38gSD0C2o4y9b9bd5QOPz2MK HTTP/1.1
Host: 192.168.5.150:8088

Response example

HTTP/1.1 200 OK
{
    "errcode": 0,
    "errmsg": "SUCCESS",
    "total_number": 1,
    "data": [
        {
            "id": 1,
            "name": "API Test Attempt Rule",
            "reset_period": "day",
            "reset_hour": 0,
            "max_attempts_contact": 5,
            "max_attempts_number": 3,
            "phonebook_ids": ""
        }
    ]
}