Rate this page:

Rules

Methods

AddRule

Copy URL

Adds a new rule for the application.

Available for roles

To call this method, make sure your service account has one of the following roles:

See Available Roles
Owner
Admin
Developer
AddRule example

AddRule example

Add a new rule.

Parameters

  • application_id:

    number

    The application ID

  • application_name:

    string

    The application name, can be used instead of application_id

  • bind_key_id:

    string

    Optional

    The service account ID to bind to the rule. Read more in the guide

  • rule_name:

    string

    The rule name. The length must be less than 100

  • rule_pattern:

    string

    The rule pattern regex. The length must be less than 64 KB

  • rule_pattern_exclude:

    string

    Optional

    The exclude pattern regex. The length must be less than 64 KB

  • scenario_id:

    intlist

    The scenario ID list separated by semicolons (;)

  • scenario_name:

    stringlist

    The scenario name list separated by semicolons (;). Can be used instead of scenario_id

  • video_conference:

    boolean

    Optional
    Defaults on:  false

    Whether video conference is required

Returns

  • result:

    number

    1

  • rule_id:

    number

    The new rule ID

DelRule

Copy URL

Deletes the rule.

Available for roles

To call this method, make sure your service account has one of the following roles:

See Available Roles
Owner
Admin
Developer
DelRule example

DelRule example

Delete the rule 1 and 3.

Parameters

  • application_id:

    intlist

    The application ID list separated by semicolons (;). Use the 'all' value to select all applications

  • application_name:

    stringlist

    The application name list separated by semicolons (;). Can be used instead of application_id

  • rule_id:

    intlist

    The rule ID list separated by semicolons (;). Use the 'all' value to select all rules

  • rule_name:

    stringlist

    The rule name list separated by semicolons (;). Can be used instead of rule_id

Returns

  • result:

    number

    1

GetRules

Copy URL

Gets the rules.

Available for roles

To call this method, make sure your service account has one of the following roles:

See Available Roles
Owner
Admin
Developer
Supervisor
Call list manager
Support
GetRules example

GetRules example

Get the first rule for the template 74951234567.

Parameters

  • application_id:

    number

    The application ID

  • application_name:

    string

    The application name that can be used instead of application_id

  • attached_key_id:

    string

    Optional

    The service account ID bound to the rule. Read more in the guide

  • count:

    number

    Optional
    Defaults on:  20

    The max returning record count

  • offset:

    number

    Optional
    Defaults on:  0

    The first N records are skipped in the output

  • rule_id:

    number

    Optional

    The rule ID to filter

  • rule_name:

    string

    Optional

    The rule name part to filter

  • template:

    string

    Optional

    Search for template matching

  • video_conference:

    boolean

    Optional

    Whether it is a video conference to filter

  • with_scenarios:

    boolean

    Optional

    Whether to get bound scenarios info

Returns

  • count:

    number

    The returned rule count

  • total_count:

    number

    The total found rule count

ReorderRules

Copy URL

Configures the rules' order in the Applications section of Control panel. Note: the rules must belong to the same application!

Available for roles

To call this method, make sure your service account has one of the following roles:

See Available Roles
Owner
Admin
Developer
ReorderRules example

ReorderRules example

Set the rule selection order: 1, 7, 3.

Parameters

  • rule_id:

    intlist

    The rule ID list separated by semicolons (;)

Returns

  • result:

    number

    1

SetRuleInfo

Copy URL

Edits the rule.

Available for roles

To call this method, make sure your service account has one of the following roles:

See Available Roles
Owner
Admin
Developer
SetRuleInfo example

SetRuleInfo example

Deny all.

Parameters

  • bind_key_id:

    string

    Optional

    The service account ID to bind to the rule. Read more in the guide

  • rule_id:

    number

    The rule ID

  • rule_name:

    string

    Optional

    The new rule name. The length must be less than 100

  • rule_pattern:

    string

    Optional

    The new rule pattern regex. The length must be less than 64 KB

  • rule_pattern_exclude:

    string

    Optional

    The new exclude pattern regex. The length must be less than 64 KB

  • video_conference:

    boolean

    Optional

    Whether video conference is required

Returns

  • result:

    number

    1