State Rules

A named bundle of state-level calling rules (hours, frequency caps, holidays) applied company-wide or to specific offers.

GET /state_rule_groups

Authorization Required
https://[your-subdomain].trackdrive.com/api/v1/state_rule_groups

List State Call Rules records.

Lists State Call Rules groups, which apply state-level business hours, call limits, or holiday schedules either account-wide or to specific offers depending on rule_scope. Requires the company_preferences permission.

Params

Param name Description
ids
Optional

Return records matching these ids.

  • Must be an array of decimal values. EG: [0, 1, 2, 3]

page
Optional

Return the next page of results.

  • Must be a number.

per_page
Optional

How many results to return per page. The default is 25.

  • Must be a number.

created_at_to
Optional

Date formatted like 2016-01-01 12:25:15 -0500

  • Must be a String

created_at_from
Optional

Date formatted like 2016-01-01 12:25:15 -0500

  • Must be a String

fulltext
Optional

Search for any record that matches this text

  • Must be a String

time_zone
Optional

Date ranges will be parsed using this time zone.

columns
Optional
Specify the columns you would like returned by the API for a given resource. Limiting the columns can significantly increase API response time since only the requested data will be processed. columns=uuid,number,created_at

Must be any combination of:

  • id
  • legacy_id
  • type
  • uuid
  • created_at
  • updated_at
  • deleted_at
  • user_updated_at
  • routes_show_path
  • routes_edit_path
  • external_record_id
  • company_id
  • rule_scope
  • offer_ids
  • name
  • description
  • state_business_hour_ids
  • state_call_limit_ids
  • state_holiday_ids
  • Must be a String

root
Optional

Pass root=false to return results without a root node and metadata.
For example:
GET /api/v1/calls?root=false will return [call1, call2, call3]
While:
GET /api/v1/calls will return {calls: [call1, call2, call3], metadata: {}}

  • Must be a boolean value: 1, true, yes, on, 0, false, no, off

GET /state_rule_groups/new

Authorization Required
https://[your-subdomain].trackdrive.com/api/v1/state_rule_groups/new

Build State Call Rules with defaults.

Returns a blank State Call Rules group populated with default attribute values, without saving it. Requires the company_preferences permission.

Params

Param name Description
rule_scope
Optional Blank value allowed

Rule Scope

  • Must be one of: company, offer.

offer_ids
Optional Blank value allowed

Offer Ids

  • Must be an array of decimal values. EG: [0, 1, 2, 3]

name
Optional Blank value allowed

Name

  • Must be a String

description
Optional Blank value allowed

Description

  • Must be a String

state_business_hour_ids
Optional Blank value allowed

State Business Hour Ids

  • Must be an array of decimal values. EG: [0, 1, 2, 3]

state_call_limit_ids
Optional Blank value allowed

State Call Limit Ids

  • Must be an array of decimal values. EG: [0, 1, 2, 3]

state_holiday_ids
Optional Blank value allowed

State Holidays Ids

  • Must be an array of decimal values. EG: [0, 1, 2, 3]

POST /state_rule_groups

Authorization Required
https://[your-subdomain].trackdrive.com/api/v1/state_rule_groups

Create State Call Rules.

Creates a State Call Rules group with a rule_scope (account-wide or restricted to specific offer_ids) and at least one of state_business_hour_ids, state_call_limit_ids, or state_holiday_ids attached. Requires the company_preferences permission.

Params

Param name Description
rule_scope
Optional Blank value allowed

Rule Scope

  • Must be one of: company, offer.

offer_ids
Optional Blank value allowed

Offer Ids

  • Must be an array of decimal values. EG: [0, 1, 2, 3]

name
Optional Blank value allowed

Name

  • Must be a String

description
Optional Blank value allowed

Description

  • Must be a String

state_business_hour_ids
Optional Blank value allowed

State Business Hour Ids

  • Must be an array of decimal values. EG: [0, 1, 2, 3]

state_call_limit_ids
Optional Blank value allowed

State Call Limit Ids

  • Must be an array of decimal values. EG: [0, 1, 2, 3]

state_holiday_ids
Optional Blank value allowed

State Holidays Ids

  • Must be an array of decimal values. EG: [0, 1, 2, 3]

GET /state_rule_groups/:id

Authorization Required
https://[your-subdomain].trackdrive.com/api/v1/state_rule_groups/:id

Get State Call Rules by id.

Fetches a single State Call Rules group by id. Requires the company_preferences permission.

PUT /state_rule_groups/:id

Authorization Required
https://[your-subdomain].trackdrive.com/api/v1/state_rule_groups/:id

Update State Call Rules by id.

Updates a State Call Rules group's scope, offers, or attached business hour, call limit, or holiday rules. Requires the company_preferences permission.

Params

Param name Description
rule_scope
Optional Blank value allowed

Rule Scope

  • Must be one of: company, offer.

offer_ids
Optional Blank value allowed

Offer Ids

  • Must be an array of decimal values. EG: [0, 1, 2, 3]

name
Optional Blank value allowed

Name

  • Must be a String

description
Optional Blank value allowed

Description

  • Must be a String

state_business_hour_ids
Optional Blank value allowed

State Business Hour Ids

  • Must be an array of decimal values. EG: [0, 1, 2, 3]

state_call_limit_ids
Optional Blank value allowed

State Call Limit Ids

  • Must be an array of decimal values. EG: [0, 1, 2, 3]

state_holiday_ids
Optional Blank value allowed

State Holidays Ids

  • Must be an array of decimal values. EG: [0, 1, 2, 3]

DELETE /state_rule_groups/:id

Authorization Required
https://[your-subdomain].trackdrive.com/api/v1/state_rule_groups/:id

Destroy State Call Rules by id.

Deletes a State Call Rules group by id. Requires the company_preferences permission.