POST /api/v1/leads
Send leads to your Trackdrive account.

Supported Formats

json

Examples

# Submit leads with a simple HTTP request
curl -X POST trackdrive.net/api/v1/leads?lead_token=yourtoken&caller_id=17193132645&email=john@gmail.com&custom_token=the_value&loan_amount=500
# Submit leads as JSON:
curl -H "Content-Type: application/json" -X POST -d '{"lead_token":"xyz","caller_id":"+18004506787","data":{"loan_amount":"501"}}' trackdrive.net/api/v1/leads

Params

Param name
Description
lead_token
optional

The lead token is set to either the offer_lead_token you get at trackdrive.net/offers or a schedule_lead_token you get from trackdrive.net/schedules. The only difference is the use of offer_lead_token will just send data to the offer which is picked up when a call is made with the caller_id of the lead. EG: If a Call Center is transferring data before they send you a call. The schedule_lead_token will start the actions associated with the schedule.

  • Must be String

caller_id
optional

The callerID for the lead. This is the number Trackdrive will dial when making outbound calls to the lead. This is also the number where Trackdrive will send SMS.

  • Must be String

email
optional

The email address for the lead. The lead's email is required for sending emails from schedules to leads.

  • Must be String

contact_field_type
optional

Pass an ID belonging to an Agent Script & Field Type to select that Custom Contact Field Type for this call.

  • Must be String

apply_to
optional

Should the data you're sending also be applied to calls associated with this lead?

  • Must be one of: calls.

blocked
optional

Set this to true in order to prevent this lead from calling any of your telephone numbers. This will also prevent all outbound actions from Trackdrive.

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

data
optional

Trackdrive will convert this hash of JSON data into tokens. Inbound and Outbound calls made and received from this Lead will automatically inherit these tokens. {interest: 'kittens', source: 'google', first_name: 'John', last_name: 'Smith'} Emails and SMS also have access to these tokens, so it's possible to send email and SMS messages that substitute tokens with values, such as {{first_name}}. Example SMS: “Hello {{first_name}} {{last_name}}, thanks for you inquiry. We will be calling you in 30 seconds from {{trackdrive_number}}”

  • Must be Hash


PUT /api/v1/leads/:caller_id/caller_opt_out
Mark a single lead as opt-out. Opted-out leads will no longer be sent SMS, Calls, or Emails.

Supported Formats

json

Examples

curl -X PUT -d '' trackdrive.localhost/api/v1/leads/17193132645/caller_opt_out?lead_token=yourtoken

# GET requests are supported
curl trackdrive.net/api/v1/leads/17193132645/caller_opt_out?lead_token=yourtoken

Params

Param name
Description
lead_token
required

The lead token is set to either the offer_lead_token you get at trackdrive.net/offers or a schedule_lead_token you get from trackdrive.net/schedules. The only difference is the use of offer_lead_token will just send data to the offer which is picked up when a call is made with the caller_id of the lead. EG: If a Call Center is transferring data before they send you a call. The schedule_lead_token will start the actions associated with the schedule.

  • Must be String


DELETE /api/v1/leads/:caller_id/caller_remove
Remove a single lead from a Schedule or Offer. This will prevent ANY additional actions being taken on behalf of the lead.

Supported Formats

json

Examples

curl -X DELETE trackdrive.localhost/api/v1/leads/17193132645/caller_remove?lead_token=yourtoken

# GET requests are supported
curl trackdrive.net/api/v1/leads/17193132645/caller_remove?lead_token=yourtoken

Params

Param name
Description
lead_token
required

The lead token is set to either the offer_lead_token you get at trackdrive.net/offers or a schedule_lead_token you get from trackdrive.net/schedules. The only difference is the use of offer_lead_token will just send data to the offer which is picked up when a call is made with the caller_id of the lead. EG: If a Call Center is transferring data before they send you a call. The schedule_lead_token will start the actions associated with the schedule.

  • Must be String


GET /api/v1/leads
List your leads.

Supported Formats

json

Params

Param name
Description
auth_token
optional

Authorize requests using your token. Get it from your profile: trackdrive.net/profile/edit

  • Must be String

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 String

created_at_from
optional

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

  • Must be String

fulltext
optional

Search for any record that matches this text

  • Must be 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 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

next_action_at_to
optional

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

  • Must be String

next_action_at_from
optional

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

  • Must be String

offer_id
optional

Refer to the offer api for details

schedule_id
optional

Schedule internal id.

contact_id
optional

Match calls that were placed by this caller.

traffic_source_id
optional

Refer to the traffic source api for details

buyer_id
optional

Refer to the buyer api for details

status
optional

Match results that have this status.

  • Must be one of: scheduled, waiting, waiting_for_schedule_to_open, running, queue, success, completed, completed_attempted, completed_connected, completed_converted, completed_with_one_call, completed_with_many_calls, exceeded_max_calls, exceeded_short_calls, dnc, failure, disabled, blocked, opt_out.

status_wait
optional

Filter for leads that are waiting before performing an action.

  • Must be one of: calls_on_hold_available, active_cc_available, no_schedule_number, ongoing_call, when_buyer_available, when_buyer_would_convert, off_hook_no_buyer_available, off_hook_not_enough_leads_queued, off_hook_no_seats_available.

number
optional

Filter for leads matching this callerid.

  • Must be String

email
optional

The email address for the lead. The lead's email is required for sending emails from schedules to leads.

  • Must be String

has_next_action
optional

Filter for leads that have more actions to perform.

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

buyer_converted
optional

Select leads that have converted.

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

offer_converted
optional

Select leads where a traffic source converted.

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

either_converted
optional

Select leads where either a buyer or traffic source converted.

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

opt_out
optional

Select leads that have opted-out.

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


GET /api/v1/leads/:id
Get details about a lead.

Supported Formats

json

Params

Param name
Description
auth_token
optional

Authorize requests using your token. Get it from your profile: trackdrive.net/profile/edit

  • Must be String


DELETE /api/v1/leads/:id/id
Destory a lead by it's internal id.

Supported Formats

json

Params

Param name
Description
auth_token
optional

Authorize requests using your token. Get it from your profile: trackdrive.net/profile/edit

  • Must be String