Our support has moved to: here

Leads API

Base resource URL: https://my.spectate.com/leads_visitors/leads

List all your leads

GET /leads_visitors/leads

Params and Options

  • extension - Append the extension for your desired data format
  • per_page - The number of results per page. Default: 5. We recommend at most 100 for fast responses.
  • page - The desired page
  • sort_by - last_name, created_at, last_activity_at, updated_at. Default: created_at.

    The Lead field to sort the results by updated_at is when the Lead object in Spectate last changed (has any one modified the Lead). last_activity_at is when the Lead was last active (e.g. last visited your site, filled out a form)

  • order_dir - DESC (descending) or ASC (ascending). Default: DESC

  • timeframe - 24_hours, today, yesterday, 7_days, 14_days, 30_days, this_month, last_month, all_time or custom. Default: all_time

    Time since the Lead was created. Use custom if you intend to also pass a start_date and end_date

  • custom_start - Format: MM/DD/YYYY. Only Leads created after 12am on the start_date will be returned. Must use custom value for timeframe param and must also specify a custom_end.
  • custom_end - Format: MM/DD/YYYY. Only Leads created before 12am on the end_date will be returned. Must use custom value for timeframe param and must also specify a custom_start.

Response

{
    "current_page": 1,
    "per_page": 2,
    "total_entries": 11,
    "leads": [{
        "lead": {
            "account_id": 2,
            "id": 1,
            "created_at": "2012-03-30T15:20:08-04:00",
            ... see "Get a Lead" section for more lead fields ...
        }
    }, {
        "lead": {
            "account_id": 2,
            "id": 2,
            "created_at": "2012-03-15T17:00:07-04:00",
            ...
        }
    }]
}

Example

curl https://my.spectate.com/leads_visitors/leads.json?api_key=<API_KEY>