Offers: Agent Scripts

Agent scripts shown during calls, combining contact field inputs with instructions agents read from and fill in live.

GET /contact_field_views

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

List records.

Returns a paginated list of an account's Agent Scripts (contact field views), ordered by their configured display order. Filter by offer_id to list the scripts belonging to one offer, or by id.

Params

Param name Description
offer_id
Optional

The offer this Agent Script belongs to.

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
  • offer_id
  • sortable_order
  • script_javascript
  • jornaya_campaign_id
  • fields_type
  • title
  • script_html
  • token_keys
  • is_default
  • name
  • context_menu_name
  • use_when_tokens_match
  • template_description
  • template_enabled
  • template_tier
  • record_token_filter_id
  • record_token_filter_data_count
  • record_token_filter_data
  • record_token_additional_id
  • record_token_additional_data_count
  • record_token_additional_data
  • 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 /contact_field_views/new

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

Build record with defaults.

Builds an unsaved Agent Script with default attributes, including token_keys pre-populated from the parent offer's contact fields, so you can preview it before calling create. Nothing is persisted.

Params

Param name Description
offer_id
Optional

Assign the record to this Offer.

title
Optional Blank value allowed

Agent Script Display Name

  • Must be a String

fields_type
Optional Blank value allowed

A unique value that will be submitted with leads to select this field type and agent script.

  • Must be a String

script_html
Optional Blank value allowed

This script will be displayed to agents when they are answering calls from consumers. Contact fields in this script will be replaced with inputs, allowing the agent to enter responses inline in the script.

  • Must be a String

token_keys
Optional Blank value allowed

These fields will be visible when this field_type is selected.

  • Must be an array of any type

sortable_order
Optional Blank value allowed

The order in which records will be sorted. Values are sorted in ascending order; smaller values are listed first.

  • Must be a decimal number.

is_default
Optional Blank value allowed

Uses this Agent Script by default when a call doesn’t match any other Agent Script’s filters.

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

script_javascript
Optional Blank value allowed

Custom JavaScript run alongside this Agent Script while agents are on the call.

  • Must be a String

jornaya_campaign_id
Optional Blank value allowed

The Jornaya campaign id associated with this Agent Script.

  • Must be a String

use_when_tokens_match
Optional Blank value allowed

Only uses this Agent Script for calls matching the token filters below.

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

token_value_ids
Optional Blank value allowed

Only uses this Agent Script for calls matching these token values.
Obtain token value ids from the Token Values collection.

attribution_token_value_ids
Optional Blank value allowed

When this Agent Script is used on a call, the call will be tagged with these token values.

record_token_filter_list
Optional Blank value allowed

Assign filters to the object by passing an array of key:value pairs

  • Must be a valid list of filters. Example filters:
    "interest:auto", "loan_amount:>=10000", "loan_amount:<=50000", "geo:!=800", "caller_id:!=anonymous"
record_token_additional_list
Optional Blank value allowed

Assign additional tokens that will be applied to leads and calls by passing a comma separated string of key:value pairs.

  • Must be a valid list of tokens. Example tokens:
    buyer_interest:loan,another_token:value

POST /contact_field_views

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

Create record.

Creates an Agent Script for an offer: an HTML script shown to live agents while they handle a call, with recognized contact-field tokens rendered as inline input fields the agent fills in during the call. fields_type must be unique per offer and is submitted with leads to select which script applies. The first script created for an offer is automatically marked as that offer's default.

Params

Param name Description
title
Required

Agent Script Display Name

  • Must be a String

offer_id
Required

Assign the record to this Offer.

fields_type
Optional Blank value allowed

A unique value that will be submitted with leads to select this field type and agent script.

  • Must be a String

script_html
Optional Blank value allowed

This script will be displayed to agents when they are answering calls from consumers. Contact fields in this script will be replaced with inputs, allowing the agent to enter responses inline in the script.

  • Must be a String

token_keys
Optional Blank value allowed

These fields will be visible when this field_type is selected.

  • Must be an array of any type

sortable_order
Optional Blank value allowed

The order in which records will be sorted. Values are sorted in ascending order; smaller values are listed first.

  • Must be a decimal number.

is_default
Optional Blank value allowed

Uses this Agent Script by default when a call doesn’t match any other Agent Script’s filters.

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

script_javascript
Optional Blank value allowed

Custom JavaScript run alongside this Agent Script while agents are on the call.

  • Must be a String

jornaya_campaign_id
Optional Blank value allowed

The Jornaya campaign id associated with this Agent Script.

  • Must be a String

use_when_tokens_match
Optional Blank value allowed

Only uses this Agent Script for calls matching the token filters below.

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

token_value_ids
Optional Blank value allowed

Only uses this Agent Script for calls matching these token values.
Obtain token value ids from the Token Values collection.

attribution_token_value_ids
Optional Blank value allowed

When this Agent Script is used on a call, the call will be tagged with these token values.

record_token_filter_list
Optional Blank value allowed

Assign filters to the object by passing an array of key:value pairs

  • Must be a valid list of filters. Example filters:
    "interest:auto", "loan_amount:>=10000", "loan_amount:<=50000", "geo:!=800", "caller_id:!=anonymous"
record_token_additional_list
Optional Blank value allowed

Assign additional tokens that will be applied to leads and calls by passing a comma separated string of key:value pairs.

  • Must be a valid list of tokens. Example tokens:
    buyer_interest:loan,another_token:value

GET /contact_field_views/:id

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

Get record by id.

Retrieves a single Agent Script by id.

PUT /contact_field_views/:id

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

Update record by id.

Updates an Agent Script's title, HTML script content, associated token fields, or display order. Marking a script as the default for its offer automatically un-defaults any other script on that same offer.

Params

Param name Description
offer_id
Optional

Assign the record to this Offer.

title
Optional

Agent Script Display Name

  • Must be a String

fields_type
Optional Blank value allowed

A unique value that will be submitted with leads to select this field type and agent script.

  • Must be a String

script_html
Optional Blank value allowed

This script will be displayed to agents when they are answering calls from consumers. Contact fields in this script will be replaced with inputs, allowing the agent to enter responses inline in the script.

  • Must be a String

token_keys
Optional Blank value allowed

These fields will be visible when this field_type is selected.

  • Must be an array of any type

sortable_order
Optional Blank value allowed

The order in which records will be sorted. Values are sorted in ascending order; smaller values are listed first.

  • Must be a decimal number.

is_default
Optional Blank value allowed

Uses this Agent Script by default when a call doesn’t match any other Agent Script’s filters.

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

script_javascript
Optional Blank value allowed

Custom JavaScript run alongside this Agent Script while agents are on the call.

  • Must be a String

jornaya_campaign_id
Optional Blank value allowed

The Jornaya campaign id associated with this Agent Script.

  • Must be a String

use_when_tokens_match
Optional Blank value allowed

Only uses this Agent Script for calls matching the token filters below.

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

token_value_ids
Optional Blank value allowed

Only uses this Agent Script for calls matching these token values.
Obtain token value ids from the Token Values collection.

attribution_token_value_ids
Optional Blank value allowed

When this Agent Script is used on a call, the call will be tagged with these token values.

record_token_filter_list
Optional Blank value allowed

Assign filters to the object by passing an array of key:value pairs

  • Must be a valid list of filters. Example filters:
    "interest:auto", "loan_amount:>=10000", "loan_amount:<=50000", "geo:!=800", "caller_id:!=anonymous"
record_token_additional_list
Optional Blank value allowed

Assign additional tokens that will be applied to leads and calls by passing a comma separated string of key:value pairs.

  • Must be a valid list of tokens. Example tokens:
    buyer_interest:loan,another_token:value

DELETE /contact_field_views/:id

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

Destroy record by id.

Soft-deletes an Agent Script by id. The record is retained but excluded from future results.