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 Requiredhttps://[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.
|
|
page Optional |
Return the next page of results.
|
|
per_page Optional |
How many results to return per page. The default is 25.
|
|
created_at_to Optional |
Date formatted like 2016-01-01 12:25:15 -0500
|
|
created_at_from Optional |
Date formatted like 2016-01-01 12:25:15 -0500
|
|
fulltext Optional |
Search for any record that matches this text
|
|
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:
|
|
root Optional |
Pass
|
GET /contact_field_views/new
Authorization Requiredhttps://[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
|
|
fields_type Optional Blank value allowed |
A unique value that will be submitted with leads to select this field type and agent script.
|
|
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.
|
|
token_keys Optional Blank value allowed |
These fields will be visible when this field_type is selected.
|
|
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.
|
|
is_default Optional Blank value allowed |
Uses this Agent Script by default when a call doesn’t match any other Agent Script’s filters.
|
|
script_javascript Optional Blank value allowed |
Custom JavaScript run alongside this Agent Script while agents are on the call.
|
|
jornaya_campaign_id Optional Blank value allowed |
The Jornaya campaign id associated with this Agent Script.
|
|
use_when_tokens_match Optional Blank value allowed |
Only uses this Agent Script for calls matching the token filters below.
|
|
token_value_ids Optional Blank value allowed |
Only uses this Agent Script for calls matching these token values.
|
|
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
|
|
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.
|
POST /contact_field_views
Authorization Requiredhttps://[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
|
|
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.
|
|
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.
|
|
token_keys Optional Blank value allowed |
These fields will be visible when this field_type is selected.
|
|
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.
|
|
is_default Optional Blank value allowed |
Uses this Agent Script by default when a call doesn’t match any other Agent Script’s filters.
|
|
script_javascript Optional Blank value allowed |
Custom JavaScript run alongside this Agent Script while agents are on the call.
|
|
jornaya_campaign_id Optional Blank value allowed |
The Jornaya campaign id associated with this Agent Script.
|
|
use_when_tokens_match Optional Blank value allowed |
Only uses this Agent Script for calls matching the token filters below.
|
|
token_value_ids Optional Blank value allowed |
Only uses this Agent Script for calls matching these token values.
|
|
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
|
|
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.
|
GET /contact_field_views/:id
Authorization Requiredhttps://[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 Requiredhttps://[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
|
|
fields_type Optional Blank value allowed |
A unique value that will be submitted with leads to select this field type and agent script.
|
|
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.
|
|
token_keys Optional Blank value allowed |
These fields will be visible when this field_type is selected.
|
|
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.
|
|
is_default Optional Blank value allowed |
Uses this Agent Script by default when a call doesn’t match any other Agent Script’s filters.
|
|
script_javascript Optional Blank value allowed |
Custom JavaScript run alongside this Agent Script while agents are on the call.
|
|
jornaya_campaign_id Optional Blank value allowed |
The Jornaya campaign id associated with this Agent Script.
|
|
use_when_tokens_match Optional Blank value allowed |
Only uses this Agent Script for calls matching the token filters below.
|
|
token_value_ids Optional Blank value allowed |
Only uses this Agent Script for calls matching these token values.
|
|
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
|
|
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.
|
DELETE /contact_field_views/:id
Authorization Requiredhttps://[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.