SIGN UP

Managing Rules

Methods

AddRule

Adds a new rule for the application.

Parameters

  • Follow link for authentication parameter names and details.

  • 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 to false

    Is video conference required?

  • scenario_id:

    string

    The scenario ID list separated by the ';' symbol.

  • scenario_name:

    string

    Can be used instead of scenario_id. The scenario name list separated by the ';' symbol.

Returns

  • result:

    number

    1

  • rule_id:

    number

    The new rule ID.

Examples

request:

Add a new rule.

https://api.voximplant.com/platform_api/AddRule/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&application_id=1&rule_name=allowall&rule_pattern=.*

response:

{
    "result": 1,
    "rule_id": 1
}

DelRule

Deletes the rule.

Parameters

  • Follow link for authentication parameter names and details.

  • rule_id:

    string

    The rule ID list separated by the ';' symbol or the 'all' value.

  • rule_name:

    string

    Can be used instead of rule_id. The rule name list separated by the ';' symbol.

  • application_id:

    string

    The application ID list separated by the ';' symbol or the 'all' value.

  • application_name:

    string

    Can be used instead of application_id. The application name list separated by the ';' symbol.

Returns

  • result:

    number

    1

Examples

request:

Delete the rule 1 and 3.

https://api.voximplant.com/platform_api/DelRule/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&rule_id=1;3

Delete the all rules from the application 1.

https://api.voximplant.com/platform_api/DelRule/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&rule_id=all&application_id=1

Delete the all rules from the all applications.

https://api.voximplant.com/platform_api/DelRule/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&rule_id=all&application_id=all

response:

Success

{
    "result": 1
}

GetRules

Gets the rules.

Parameters

  • Follow link for authentication parameter names and details.

  • 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 binding scenarios info.

  • count:

    number
    Optional
    Defaults to 20

    The max returning record count.

  • offset:

    number
    Optional
    Defaults to 0

    The first N records will be skipped in the output.

Returns

  • result:

    [ RuleInfoType ]
  • total_count:

    number

    The total found rule count.

  • count:

    number

    The returned rule count.

Examples

request:

Get the first rule for the template 74951234567

https://api.voximplant.com/platform_api/GetRules/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&application=1&template=74951234567&with_scenarios=true&count=1

response:

{
    "count": 1,
    "result": [
        {
            "rule_id": 10,
            "modified": "2013-09-09 17:07:29",
            "rule_name": "Moscow",
            "scenarios": [
                {
                    "modified": "2013-09-09 16:36:50",
                    "scenario_id": 3,
                    "scenario_name": "scen3"
                },
                {
                    "modified": "2013-09-09 16:35:55",
                    "scenario_id": 2,
                    "scenario_name": "scen2"
                }
            ],
            "rule_pattern": "749[59].+",
            "application_id": 1,
            "video_conference": false
        }
    ],
    "total_count": 1
}

ReorderRules

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

Parameters

  • Follow link for authentication parameter names and details.

  • rule_id:

    string

    The rule ID list separated by the ';' symbol.

Returns

  • result:

    number

    1

Examples

request:

Set the rule selection order: 1, 7, 3

https://api.voximplant.com/platform_api/ReorderRules/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&rule_id=1;7;3

response:

Success

{
    "result": 1
}

SetRuleInfo

Edits the rule.

Parameters

  • Follow link for authentication parameter names and details.

  • 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

    Is video conference required?

Returns

  • result:

    number

    1

Examples

request:

Deny all.

https://api.voximplant.com/platform_api/SetRuleInfo/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&rule_id=1&rule_name=denyall&rule_pattern_exclude=.*

response:

Success

{
    "result": 1
}