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

  • 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

  • video_conference:

    boolean

    Optional
    Defaults on:  false

    Video conference is required

  • scenario_id:

    intlist

    The scenario ID list separated by semicolon (;)

  • scenario_name:

    stringlist

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

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

  • rule_id:

    intlist

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

  • rule_name:

    stringlist

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

  • application_id:

    intlist

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

  • application_name:

    stringlist

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

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

  • 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

    Video conference is required

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

  • rule_id:

    number

    Optional

    The rule ID to filter

  • rule_name:

    string

    Optional

    The rule name part to filter

  • video_conference:

    boolean

    Optional

    The video conference flag to filter

  • template:

    string

    Optional

    Search for template matching

  • with_scenarios:

    boolean

    Optional

    Set true to get bound scenarios info

  • count:

    number

    Optional
    Defaults on:  20

    The max returning record count

  • offset:

    number

    Optional
    Defaults on:  0

    The first N records will be skipped in the output

Returns

  • total_count:

    number

    The total found rule count

  • count:

    number

    The returned 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 semicolon (;)

Returns

  • result:

    number

    1