GET /api/v1/phone_numbers
Get the phone numbers assigned to your account.

Supported Formats

json, csv

Examples

curl -H "Authorization: Basic BASE64_ENCODED_PUBLIC_KEY_AND_PRIVATE_KEY" "https://[your-subdomain].trackdrive.com/api/v1/phone_numbers?number=+441224980000&"

Params

Param name
Description
serializer
Optional Blank Value Allowed

This endpoint supports multiple response formats. Pass serializer=name to retrieve data in an alternate format.

  • Must be a value contained in the pick list:
    Acceptable ValueDescription
    numberDefault response format.
    number_gridModern response format that returns various foreign keys for use with other API endpoints.
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
  • name
  • number
  • offer_id
  • traffic_source_id
  • provider_configuration_id
  • description
  • ring_pool_id
  • provider_auth_key
  • last_call_at
  • token_values
  • country
  • area_code_id
  • optimizer_displayed_at
  • optimizer_tokens_changed_at
  • plain_number
  • extension
  • checksum
  • human_number
  • 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

number
Optional

The phone number.

  • Must be a String

offer_id
Optional

Refer to the offer api for details

  • Must be a decimal number.

traffic_source_id
Optional

Refer to the traffic source api for details

  • Must be a decimal number.

provider_configuration_id
Optional

Refer to the provider api for details

  • Must be a decimal number.

ring_pool_id
Optional

Refer to the Number Pool api for details

  • Must be a decimal number.

last_call_at_to
Optional

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

  • Must be a String

last_call_at_from
Optional

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

  • Must be a String


POST /api/v1/phone_numbers
Purchase a new phone number using one of your existing provider configurations.

Supported Formats

json

Examples

curl -H "Authorization: Basic BASE64_ENCODED_PUBLIC_KEY_AND_PRIVATE_KEY" -H "Content-Type: application/json" -X POST -d '{provider_configuration_id: 150, offer_id: 100, toll_free: true, country: 'US'}' https://[your-subdomain].trackdrive.com/api/v1/phone_numbers.json

Params

Param name
Description
serializer
Optional Blank Value Allowed

This endpoint supports multiple response formats. Pass serializer=name to retrieve data in an alternate format.

  • Must be a value contained in the pick list:
    Acceptable ValueDescription
    numberDefault response format.
    number_gridModern response format that returns various foreign keys for use with other API endpoints.
provider_configuration_id
Required

Refer to the provider api for details

offer_id
Required

Refer to the offer api for details

toll_free
Required

Purchase a toll-free or local number? true for toll-free, false for local number.

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

country
Required

The country where the number will be purchased.

  • Must be one of: AR, AT, AU, BE, BG, BH, BR, CA, CH, CL, CN, CO, CY, CZ, DE, DK, DO, EE, ES, FI, FR, GB, GE, GR, HK, HR, HU, ID, IE, IL, IT, JP, KR, LT, LU, LV, MT, MX, MY, NL, NO, NZ, PA, PE, PH, PK, PL, PR, PT, RO, RU, SE, SG, SI, SK, SV, TR, US, ZA.

traffic_source_id
Optional Blank Value Allowed

Refer to the traffic source api for details

ring_pool_id
Optional Blank Value Allowed

Refer to the Number Pool api for details

traffic_source_override_lead_traffic_source
Optional Blank Value Allowed

Force Calls to Credit This Traffic Source and Extra Tokens, even if Lead Traffic Source or Data is Different

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

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 /api/v1/phone_numbers/:id
Show the details of phone number

Supported Formats

json

Examples

curl -H "Authorization: Basic BASE64_ENCODED_PUBLIC_KEY_AND_PRIVATE_KEY" https://[your-subdomain].trackdrive.com/api/v1/phone_numbers/20590

Params

Param name
Description
serializer
Optional Blank Value Allowed

This endpoint supports multiple response formats. Pass serializer=name to retrieve data in an alternate format.

  • Must be a value contained in the pick list:
    Acceptable ValueDescription
    numberDefault response format.
    number_gridModern response format that returns various foreign keys for use with other API endpoints.
id
Optional

This can be either the internal trackdrive id or the full phone number beginning with '+'
For example:
To find a number using trackdrive's internal id pass id=185923
To find a number using the phone number pass id=+18005002562"

  • Must be a String


PUT /api/v1/phone_numbers/:id
Update a phone number's traffic source or Number Pool

Supported Formats

json

Examples

curl -H "Authorization: Basic BASE64_ENCODED_PUBLIC_KEY_AND_PRIVATE_KEY" -H "Content-Type: application/json" -X PUT -d '{"traffic_source_id":"1002592"}' https://[your-subdomain].trackdrive.com/api/v1/phone_numbers/:id

Params

Param name
Description
serializer
Optional Blank Value Allowed

This endpoint supports multiple response formats. Pass serializer=name to retrieve data in an alternate format.

  • Must be a value contained in the pick list:
    Acceptable ValueDescription
    numberDefault response format.
    number_gridModern response format that returns various foreign keys for use with other API endpoints.
id
Optional

This can be either the internal trackdrive id or the full phone number beginning with '+'
For example:
To find a number using trackdrive's internal id pass id=185923
To find a number using the phone number pass id=+18005002562"

  • Must be a String

offer_id
Optional Blank Value Allowed

Refer to the offer api for details

traffic_source_id
Optional Blank Value Allowed

Refer to the traffic source api for details

ring_pool_id
Optional Blank Value Allowed

Refer to the Number Pool api for details

traffic_source_override_lead_traffic_source
Optional Blank Value Allowed

Force Calls to Credit This Traffic Source and Extra Tokens, even if Lead Traffic Source or Data is Different

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

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 /api/v1/phone_numbers/:id
Unrent a phone number.

Supported Formats

json

Examples

curl -H "Authorization: Basic BASE64_ENCODED_PUBLIC_KEY_AND_PRIVATE_KEY" -H "Content-Type: application/json" -X DELETE https://[your-subdomain].trackdrive.com/api/v1/phone_numbers/:id

Params

Param name
Description
serializer
Optional Blank Value Allowed

This endpoint supports multiple response formats. Pass serializer=name to retrieve data in an alternate format.

  • Must be a value contained in the pick list:
    Acceptable ValueDescription
    numberDefault response format.
    number_gridModern response format that returns various foreign keys for use with other API endpoints.
id
Optional

This can be either the internal trackdrive id or the full phone number beginning with '+'
For example:
To find a number using trackdrive's internal id pass id=185923
To find a number using the phone number pass id=+18005002562"

  • Must be a String