GET /api/v1/subscriptions
List Subscriptions

Supported Formats

json

Examples

curl -H "Authorization: Basic BASE64_ENCODED_PUBLIC_KEY_AND_PRIVATE_KEY" "https://[your-subdomain].trackdrive.com/api/v1/subscriptions?page=1&order=created_at"

Response Example

{
  "status": 200,
  "errors": {},
  "subscription": {
    "id": 12903879,
    "target_url": "https://hooks.zapier.com/hooks/standard/535583948/f4cbb291874a4cc1a97e10csdfdsscd/",
    "event": "new_call",
    "trigger_fields": {
      "offer_converted": true,
      "traffic_source_id": 9210831092
    }
  },
  "checksum": "4d84e664cccd79edc08cde90f16244eb",
  "metadata": {
    "root": "subscription"
  }
}

Params

Param name
Description
page
Optional

Return the next page of results.

  • Must be a number.


GET /api/v1/webhook_subscriptions/new
Build Webhook Subscription with defaults.

Response Example

{
  "status": 200,
  "errors": {},
  "subscription": {
    "id": 12903879,
    "target_url": "https://hooks.zapier.com/hooks/standard/535583948/f4cbb291874a4cc1a97e10csdfdsscd/",
    "event": "new_call",
    "trigger_fields": {
      "offer_converted": true,
      "traffic_source_id": 9210831092
    }
  },
  "checksum": "4d84e664cccd79edc08cde90f16244eb",
  "metadata": {
    "root": "subscription"
  }
}

POST /api/v1/subscriptions
Create a subscription

Supported Formats

json

Examples

curl -H "Authorization: Basic BASE64_ENCODED_PUBLIC_KEY_AND_PRIVATE_KEY" -H "Content-Type: application/json" -X POST -d '{"target_url": "https://hooks.zapier.com/<unique_path>", "event": "new_call"}' https://[your-subdomain].trackdrive.com/api/v1/subscriptions

Response Example

{
  "status": 200,
  "errors": {},
  "subscription": {
    "id": 12903879,
    "target_url": "https://hooks.zapier.com/hooks/standard/535583948/f4cbb291874a4cc1a97e10csdfdsscd/",
    "event": "new_call",
    "trigger_fields": {
      "offer_converted": true,
      "traffic_source_id": 9210831092
    }
  },
  "checksum": "4d84e664cccd79edc08cde90f16244eb",
  "metadata": {
    "root": "subscription"
  }
}

Params

Param name
Description
target_url
Required

The unique auto-generated subscription URL where Trackdrive will send JSON data when the event is triggered.

  • Must be a valid URL.

event
Required

The event that will be triggered. EG: When a new call comes in.

  • Must be one of: new_call, call_ringing, call_forwarded, call_ended, call_changed, new_lead, lead_ended, lead_converted, lead_opted_out, lead_changed, incoming_text_message.

trigger_fields
Optional

Filter the data returned by the subscription. Only trigger if the object matches the given trigger fields. For example:
{buyer_converted: true, offer_id: 1} would only fire the trigger if the call converted and came from offer 1. Acceptable triggers: schedule_id traffic_source_id offer_id buyer_converted has_recording either_converted buyer_id offer_converted number_id

  • Must be a Hash


Supported Formats

json

Examples

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

Response Example

{
  "status": 200,
  "errors": {},
  "subscription": {
    "id": 12903879,
    "target_url": "https://hooks.zapier.com/hooks/standard/535583948/f4cbb291874a4cc1a97e10csdfdsscd/",
    "event": "new_call",
    "trigger_fields": {
      "offer_converted": true,
      "traffic_source_id": 9210831092
    }
  },
  "checksum": "4d84e664cccd79edc08cde90f16244eb",
  "metadata": {
    "root": "subscription"
  }
}

PUT /api/v1/subscriptions/:id
Update a subscription

Supported Formats

json

Examples

curl -H "Authorization: Basic BASE64_ENCODED_PUBLIC_KEY_AND_PRIVATE_KEY" -H "Content-Type: application/json" -X PUT -d '{"target_url": "https://hooks.zapier.com/<unique_path>", "event": "new_call"}' https://[your-subdomain].trackdrive.com/api/v1/subscriptions/123456789

Response Example

{
  "status": 200,
  "errors": {},
  "subscription": {
    "id": 12903879,
    "target_url": "https://hooks.zapier.com/hooks/standard/535583948/f4cbb291874a4cc1a97e10csdfdsscd/",
    "event": "new_call",
    "trigger_fields": {
      "offer_converted": true,
      "traffic_source_id": 9210831092
    }
  },
  "checksum": "4d84e664cccd79edc08cde90f16244eb",
  "metadata": {
    "root": "subscription"
  }
}

Params

Param name
Description
target_url
Optional

The unique auto-generated subscription URL where Trackdrive will send JSON data when the event is triggered.

  • Must be a valid URL.

event
Optional

The event that will be triggered. EG: When a new call comes in.

  • Must be one of: new_call, call_ringing, call_forwarded, call_ended, call_changed, new_lead, lead_ended, lead_converted, lead_opted_out, lead_changed, incoming_text_message.


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/subscriptions/123456789

Response Example

{
  "status": 200,
  "errors": {},
  "subscription": {
    "id": 12903879,
    "target_url": "https://hooks.zapier.com/hooks/standard/535583948/f4cbb291874a4cc1a97e10csdfdsscd/",
    "event": "new_call",
    "trigger_fields": {
      "offer_converted": true,
      "traffic_source_id": 9210831092
    }
  },
  "checksum": "4d84e664cccd79edc08cde90f16244eb",
  "metadata": {
    "root": "subscription"
  }
}

DELETE /api/v1/subscriptions
Delete a subscription matching a target_url

Supported Formats

json

Examples

curl -H "Authorization: Basic BASE64_ENCODED_PUBLIC_KEY_AND_PRIVATE_KEY" -H "Content-Type: application/json" -X DELETE  -d '{"target_url": "https://hooks.zapier.com/<unique_path>"}' https://[your-subdomain].trackdrive.com/api/v1/subscriptions

Response Example

{
  "status": 200,
  "errors": {},
  "subscription": {
    "id": 12903879,
    "target_url": "https://hooks.zapier.com/hooks/standard/535583948/f4cbb291874a4cc1a97e10csdfdsscd/",
    "event": "new_call",
    "trigger_fields": {
      "offer_converted": true,
      "traffic_source_id": 9210831092
    }
  },
  "checksum": "4d84e664cccd79edc08cde90f16244eb",
  "metadata": {
    "root": "subscription"
  }
}

Params

Param name
Description
target_url
Optional

The unique auto-generated subscription URL where Trackdrive will send JSON data when the event is triggered.

  • Must be a String