Temporal Rules Sets

About Temporal Rules Sets

A temporal rule set is a collection of temporal rules that can be used in a callflow to match more that one rule and can also be re-used.

For instance, one could define each holiday as a temporal rule, then create a temporal rule set with all of the holiday temporal rule IDs added. Then this temporal rule set could be used (one ID) versus needing to list all temporal rule IDs for use elsewhere.

Schema

Schema for a temporal rules sets

KeyDescriptionTypeDefaultRequiredSupport Level
flags.[]string()falsesupported
flagsFlags set by external applicationsarray(string())falsesupported
nameA friendly name for the temporal rule setstring(1..128)truesupported
temporal_rules.[]string()falsesupported
temporal_rulesTemporal rule IDsarray(string())falsesupported

List available rule sets

GET /v2/accounts/{ACCOUNT_ID}/temporal_rules_sets

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/temporal_rules_sets

Create a new rule set

PUT /v2/accounts/{ACCOUNT_ID}/temporal_rules_sets

curl -v -X PUT \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -H "Content-Type: application/json" \
    -d '{"data": {"name": "July","temporal_rules": ["{RULE_ID}","{RULE_ID}"]}}' \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/temporal_rules_sets

Fetch a rule set

GET /v2/accounts/{ACCOUNT_ID}/temporal_rules_sets/{TEMPORAL_RULE_SET}

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/temporal_rules_sets/{TEMPORAL_RULE_SET}

Change a rule set

POST /v2/accounts/{ACCOUNT_ID}/temporal_rules_sets/{TEMPORAL_RULE_SET}

curl -v -X POST \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -H "Content-Type: application/json" \
    -d '{"data": {"name": "July","temporal_rules": ["{RULE_ID}","{RULE_ID}"]}}' \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/temporal_rules_sets/{TEMPORAL_RULE_SET}

Patch a rule set

PATCH /v2/accounts/{ACCOUNT_ID}/temporal_rules_sets/{TEMPORAL_RULE_SET}

curl -v -X PATCH \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/temporal_rules_sets/{TEMPORAL_RULE_SET}

Remove a rule set

DELETE /v2/accounts/{ACCOUNT_ID}/temporal_rules_sets/{TEMPORAL_RULE_SET}

curl -v -X DELETE \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/temporal_rules_sets/{TEMPORAL_RULE_SET}