LEADS

Client level API for accessing a client's leads and lead information.

endpoint: https://api.idxbroker.com/leads/[...]

This is a simple, access anywhere, method for getting a list of all API components available.

  • GET

    • primary request ID: none
    • secondary request ID: none
    • additional input: none
    • output: all available APIs/Components
    // access URL and request method
    $url = 'https://api.idxbroker.com/leads/listcomponents';
    $method = 'GET';
    
    // headers (required and optional)
    $headers = array(
    	'Content-Type: application/x-www-form-urlencoded', // required
    	'accesskey: abcdefghijklmnopqrstuvwx', // required - replace with your own
    	'outputtype: json' // optional - overrides the preferences in our API control page
    );
    
    // set up cURL
    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $url);
    curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    
    if ($method != 'GET')
    	curl_setopt($handle, CURLOPT_CUSTOMREQUEST, $method);
    
    // exec the cURL request and returned information. Store the returned HTTP code in $code for later reference
    $response = curl_exec($handle);
    $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    
    if ($code >= 200 || $code < 300)
    	$components = json_decode($response,true);
    else
    	$error = $code;
    											
  • POST None

  • PUT None

  • DELETE None

A simple method for listing all available methods in the current API component. This method will also list which request methods (GET, PUT, POST, or DELETE) are supported by each method.

  • GET

    • primary request ID: none
    • secondary request ID: none
    • additional input: none
    • output: basic information about all available methods in this API. Data includes:
      • Method Name
      • The list of actions (GET, POST, etc) and a boolean denoting whether or not the action is available in the method.
      • The method's status.
        • indev: This method is in development. Input or output may change without notice.
        • active: This method is operating normally.
        • deprecated: The functionality of this method is being superceeded by another as described in the method description.
        • sunset: This method is no longer available.
      • A one to two sentence description of the method.
    // access URL and request method
    $url = 'https://api.idxbroker.com/leads/listmethods';
    $method = 'GET';
    
    // headers (required and optional)
    $headers = array(
    	'Content-Type: application/x-www-form-urlencoded', // required
    	'accesskey: abcdefghijklmnopqrstuvwx', // required - replace with your own
    	'outputtype: json' // optional - overrides the preferences in our API control page
    );
    
    // set up cURL
    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $url);
    curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    
    if ($method != 'GET')
    	curl_setopt($handle, CURLOPT_CUSTOMREQUEST, $method);
    
    // exec the cURL request and returned information. Store the returned HTTP code in $code for later reference
    $response = curl_exec($handle);
    $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    
    if ($code >= 200 || $code < 300)
    	$response = json_decode($response,true);
    else
    	$error = $code;
    											
  • POST None

  • PUT None

  • DELETE None

Get information for one or multiple leads during a specified time frame of up to 1 week. Also ability to add or modify single leads.

  • GET

    Get lead information for one or more leads during a specified time frame of up to 1 week.
    • primary request ID: leadID optional The ID of a lead.
    • secondary request ID: none
    • additional input:
      • interval optional - the number of hours worth of data to return.
        • This must be a numeric value but can be an integer or a decimal. E.g. to get the last 90 minutes you would use an interval value of 1.5.
          • Up to 4 digits after the decimal point will be tolerated, additional precision will be rounded off.
          • Intervals will also be rounded to the nearest second.
        • The interval specifies the number of hours before the startDatetime from which lead information will be returned.
        • Minimum value: 0.0166 (~ 1 minute). Maximum value: 168 (1 week).
        • If no value is specified 1 hour will we used.
      • startDatetime optional - the date and time to from which the interval counts back.
        • This is the date and time closest to now from which you want lead information. E.g. if you want all leads created on New Year's Day you could use an interval of 24 plus a startDatetime of 2013-01-01 23:59:59. This will pull data from the very end of the day to 24 hours previous.
        • Format: YYYY-MM-DD hh:mm:ss
        • This method currently assumes the date passed will be UTC
        • If no value is specified the current date/time will be used
      • dateType optional - there are several dates associated with a lead, this will specify what is being used to return information.
        • Possible Values:
          • subscribeDate - set at the time the lead signed up or was added to the system via API or middleware.
          • lastEdited - set any time lead information is edited.
          • lastLoginDate - the last time the lead logged in to their account.
          • lastPropertyUpdateDate - the last time the lead received property updates.
          • lastActivityDate - the last time the lead was active. This could be a login, a saved property, or a saved search.
        • If no value is specified subscribeDate will be used.
      • rf optional array of fields to return in the output
        • List of available return fields can be obtained via the listmethods method.
        • rf[]=* or rf=* returns all the available fields in the output
        • Specified fields that are not in the available return fields list will be ignored
    • output: If a lead ID is provided detailed information about that lead is returned. Otherwise simple information about all leads is returned
    // access URL and request method
    $url = 'https://api.idxbroker.com/leads/lead?interval=24&startDatetime=2012-01-01+23:59:59&dateType=subscribeDate';
    $method = 'GET';
    
    // headers (required and optional)
    $headers = array(
    	'Content-Type: application/x-www-form-urlencoded', // required
    	'accesskey: abcdefghijklmnopqrstuvwx', // required - replace with your own
    	'outputtype: json' // optional - overrides the preferences in our API control page
    );
    
    // set up cURL
    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $url);
    curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    
    if ($method != 'GET')
    	curl_setopt($handle, CURLOPT_CUSTOMREQUEST, $method);
    
    // exec the cURL request and returned information. Store the returned HTTP code in $code for later reference
    $response = curl_exec($handle);
    $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    
    if ($code >= 200 || $code < 300)
    	$response = json_decode($response,true);
    else
    	$error = $code;
    											
  • POST

    Update the information for one lead specified by the primary request ID.
    • primary request ID: leadID required The ID of a lead.
    • secondary request ID: none
    • additional input: optional update fields in a URL encoded, ampersand delineated, query string format
    • output: If no POST data is supplied then a list of updatable fields with format information is returned
    // access URL and request method
    $url = 'https://api.idxbroker.com/leads/lead/1';
    $data = array(
    	'firstName'=>'Aaron',
    	'lastName'=>'Aaronson',
    	'email'=>'aaaaaaaaaronson@fake-email.com'
    );
    $data = http_build_query($data); // encode and & delineate
    $method = 'POST';
    
    // headers (required and optional)
    $headers = array(
    	'Content-Type: application/x-www-form-urlencoded', // required
    	'accesskey: abcdefghijklmnopqrstuvwx', // required - replace with your own
    	'outputtype: json' // optional - overrides the preferences in our API control page
    );
    
    // set up cURL
    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $url);
    curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    
    if ($method != 'GET')
    	curl_setopt($handle, CURLOPT_CUSTOMREQUEST, $method);
    // send the data
    curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
    
    // exec the cURL request and returned information. Store the returned HTTP code in $code for later reference
    $response = curl_exec($handle);
    $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    
    if ($code >= 200 || $code < 300)
    	$response = json_decode($response,true);
    else
    	$error = $code;
    											
  • PUT

    Create a new lead.
    • primary request ID: none
    • secondary request ID: none
    • additional input: optional update fields in a URL encoded, ampersand delineated, query string format
    • output: If a lead is successfully created the new lead's ID will be returned.
      If no PUT data is supplied then a list of updatable fields with format information is returned.
      Special note: Currently the API cannot differentiate between a lead rejected due to server error or one rejected due to bad email address. The lead system requires email addresses that are correctly formatted to cut down on garbage accounts, and they need to have a valid MX record. Most 500 error from this method are a result of bad email addresses. In future versions we will differentiate the error and make the MX record requirement optional.
    // access URL and request method
    $url = 'https://api.idxbroker.com/leads/lead';
    $data = array(
    	'firstName'=>'Aaron',
    	'lastName'=>'Aaronson',
    	'email'=>'aaaaaaaaaronson@fake-email.com'
    );
    $data = http_build_query($data); // encode and & delineate
    $method = 'PUT';
    
    // headers (required and optional)
    $headers = array(
    	'Content-Type: application/x-www-form-urlencoded', // required
    	'accesskey: abcdefghijklmnopqrstuvwx', // required - replace with your own
    	'outputtype: json' // optional - overrides the preferences in our API control page
    );
    
    // set up cURL
    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $url);
    curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    
    if ($method != 'GET')
    	curl_setopt($handle, CURLOPT_CUSTOMREQUEST, $method);
    // send the data
    curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
    
    // exec the cURL request and returned information. Store the returned HTTP code in $code for later reference
    $response = curl_exec($handle);
    $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    
    if ($code >= 200 || $code < 300)
    	$response = json_decode($response,true);
    else
    	$error = $code;
    											
  • DELETE

    Remove a lead system wide.
    • primary request ID: leadID required The ID of a lead.
    • secondary request ID: none
    • additional input: none
    • output: none (204 on success)
    // access URL and request method
    $url = 'https://api.idxbroker.com/leads/lead/123';
    $method = 'DELETE';
    
    // headers (required and optional)
    $headers = array(
    	'Content-Type: application/x-www-form-urlencoded', // required
    	'accesskey: abcdefghijklmnopqrstuvwx', // required - replace with your own
    	'outputtype: json' // optional - overrides the preferences in our API control page
    );
    
    // set up cURL
    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $url);
    curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    
    if ($method != 'GET')
    	curl_setopt($handle, CURLOPT_CUSTOMREQUEST, $method);
    
    // exec the cURL request and returned information. Store the returned HTTP code in $code for later reference
    $response = curl_exec($handle);
    $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    
    if ($code >= 200 || $code < 300)
    	$response = json_decode($response,true);
    else
    	$error = $code;
    											
  • GET None

  • POST None

  • PUT

    • primary request ID: none
    • secondary request ID: none
    • additional input: optional update fields in a URL encoded, ampersand delineated, query string format. Each lead field should be passed as an indexed array starting at and going to, at most, 100. There must not be any gaps.
    • output: If a lead is successfully created the new lead IDs will be returned. If no PUT data is supplied then a list of updatable fields with format information is returned.
    // access URL and request method
    $url = 'https://api.idxbroker.com/leads/bulklead';
    $data = array(
    	'firstName[0]'=>'Aaron',
    	'lastName[0]'=>'Aaronson',
    	'email[0]'=>'aaaaaaaaaronson@fake-email.com',
    	'firstName[1]'=>'Alan',
    	'lastName[1]'=>'Aaronson',
    	'email[1]'=>'alanaaronson@fake-site.com'
    );
    $data = http_build_query($data); // encode and & delineate
    $method = 'PUT';
    
    // headers (required and optional)
    $headers = array(
    	'Content-Type: application/x-www-form-urlencoded', // required
    	'accesskey: abcdefghijklmnopqrstuvwx', // required - replace with your own
    	'outputtype: json' // optional - overrides the preferences in our API control page
    );
    
    // set up cURL
    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $url);
    curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    
    if ($method != 'GET')
    	curl_setopt($handle, CURLOPT_CUSTOMREQUEST, $method);
    // send the data
    curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
    
    // exec the cURL request and returned information. Store the returned HTTP code in $code for later reference
    $response = curl_exec($handle);
    $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    
    if ($code >= 200 || $code < 300)
    	$response = json_decode($response,true);
    else
    	$error = $code;
    											
  • DELETE None

Get, create or modify the notes that are stored about a lead.

  • GET

    Get notes for a lead.
    • primary request ID: leadID required The ID of a lead.
    • secondary request ID: noteID optional The ID of a lead's note.
    • additional input:
      • interval optional - the number of hours worth of data to return.
        • This must be a numeric value but can be an integer or a decimal. E.g. to get the last 90 minutes you would use an interval value of 1.5.
          • Up to 4 digits after the decimal point will be tolerated, additional precision will be rounded off.
          • Intervals will also be rounded to the nearest second.
        • The interval specifies the number of hours before the startDatetime from which lead notes will be returned.
        • Minimum value: 0.0166 (~ 1 minute). Maximum value: 168 (1 week).
        • If no value is specified 1 hour will we used.
      • startDatetime optional - the date and time to from which the interval counts back.
        • This is the date and time closest to now from which you want lead note. E.g. if you want all lead notes on New Year's Day you could use an interval of 24 plus a startDatetime of 2013-01-01 23:59:59. This will pull data from the very end of the day to 24 hours previous.
        • Format: YYYY-MM-DD hh:mm:ss
        • This method currently assumes the date passed will be UTC
        • If no value is specified the current date/time will be used
      • dateType optional - there are several dates associated with a lead note, this will specify what is being used to return information.
        • Possible Values:
          • created - the date/time the lead note is added to our system.
          • lastAltered - the date/tome the lead note is updated in our system.
        • If no value is specified created will be used.
      • rf optional array of fields to return in the output
        • List of available return fields can be obtained via the listmethods method.
        • rf[]=* or rf=* returns all the available fields in the output
        • Specified fields that are not in the available return fields list will be ignored
    • output: Lead note information. If no note ID is sent all notes for the lead are returned. If a note ID is passed only the one note is returned.
    // access URL and request method
    $url = 'https://api.idxbroker.com/leads/note/1/1?interval=24&startDatetime=2012-01-01+23:59:59&dateType=created';
    $method = 'GET';
    
    // headers (required and optional)
    $headers = array(
    	'Content-Type: application/x-www-form-urlencoded', // required
    	'accesskey: abcdefghijklmnopqrstuvwx', // required - replace with your own
    	'outputtype: json' // optional - overrides the preferences in our API control page
    );
    
    // set up cURL
    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $url);
    curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    
    if ($method != 'GET')
    	curl_setopt($handle, CURLOPT_CUSTOMREQUEST, $method);
    
    // exec the cURL request and returned information. Store the returned HTTP code in $code for later reference
    $response = curl_exec($handle);
    $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    
    if ($code >= 200 || $code < 300)
    	$response = json_decode($response,true);
    else
    	$error = $code;
    											
  • POST

    Update the notes information for one lead specified by the primary request ID.
    • primary request ID: leadID required The ID of a lead.
    • secondary request ID: noteID required The ID of a lead's note.
    • additional input: optional update fields in a URL encoded, ampersand delineated, query string format
    • output: If no POST data is supplied then a list of updatable fields with format information is returned
    // access URL and request method
    $url = 'https://api.idxbroker.com/leads/note/1/1';
    $data = array(
    	'note'=>'Loves almonds'
    );
    $data = http_build_query($data); // encode and & delineate
    $method = 'POST';
    
    // headers (required and optional)
    $headers = array(
    	'Content-Type: application/x-www-form-urlencoded', // required
    	'accesskey: abcdefghijklmnopqrstuvwx', // required - replace with your own
    	'outputtype: json' // optional - overrides the preferences in our API control page
    );
    
    // set up cURL
    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $url);
    curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    
    if ($method != 'GET')
    	curl_setopt($handle, CURLOPT_CUSTOMREQUEST, $method);
    // send the data
    curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
    
    // exec the cURL request and returned information. Store the returned HTTP code in $code for later reference
    $response = curl_exec($handle);
    $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    
    if ($code >= 200 || $code < 300)
    	$response = json_decode($response,true);
    else
    	$error = $code;
    											
  • PUT

    Create a new lead note.
    • primary request ID: leadID required The ID of a lead.
    • secondary request ID: none
    • additional input: optional update fields in a URL encoded, ampersand delineated, query string format
    • output: If a note is successfully created the new notes's ID will be returned. If no PUT data is supplied then a list of updatable fields with format information is returned
    // access URL and request method
    $url = 'https://api.idxbroker.com/leads/note/1';
    $data = array(
    	'note'=>'Smells like vanilla'
    );
    $data = http_build_query($data); // encode and & delineate
    $method = 'PUT';
    
    // headers (required and optional)
    $headers = array(
    	'Content-Type: application/x-www-form-urlencoded', // required
    	'accesskey: abcdefghijklmnopqrstuvwx', // required - replace with your own
    	'outputtype: json' // optional - overrides the preferences in our API control page
    );
    
    // set up cURL
    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $url);
    curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    
    if ($method != 'GET')
    	curl_setopt($handle, CURLOPT_CUSTOMREQUEST, $method);
    // send the data
    curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
    
    // exec the cURL request and returned information. Store the returned HTTP code in $code for later reference
    $response = curl_exec($handle);
    $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    
    if ($code >= 200 || $code < 300)
    	$response = json_decode($response,true);
    else
    	$error = $code;
    											
  • DELETE

    Remove a lead note.
    • primary request ID: leadID required The ID of a lead.
    • secondary request ID: noteID required The ID of the note to delete.
    • additional input: none
    • output: none (204 on success)
    // access URL and request method
    $url = 'https://api.idxbroker.com/leads/note/1/1';
    $method = 'DELETE';
    
    // headers (required and optional)
    $headers = array(
    	'Content-Type: application/x-www-form-urlencoded', // required
    	'accesskey: abcdefghijklmnopqrstuvwx', // required - replace with your own
    	'outputtype: json' // optional - overrides the preferences in our API control page
    );
    
    // set up cURL
    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $url);
    curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    
    if ($method != 'GET')
    	curl_setopt($handle, CURLOPT_CUSTOMREQUEST, $method);
    
    // exec the cURL request and returned information. Store the returned HTTP code in $code for later reference
    $response = curl_exec($handle);
    $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    
    if ($code >= 200 || $code < 300)
    	$response = json_decode($response,true);
    else
    	$error = $code;
    											

Get, create or modify the saved properties (which power property updates) that are stored for a lead.

  • GET

    Get saved properties for a lead during a specified time frame of up to 1 week.
    • primary request ID: leadID required The ID of a lead.
    • secondary request ID: propertyID optional The ID of a lead's saved property.
    • additional input:
      • interval optional - the number of hours worth of data to return.
        • This must be a numeric value but can be an integer or a decimal. E.g. to get the last 90 minutes you would use an interval value of 1.5.
          • Up to 4 digits after the decimal point will be tolerated, additional precision will be rounded off.
          • Intervals will also be rounded to the nearest second.
        • The interval specifies the number of hours before the startDatetime from which lead's saved property will be returned.
        • Minimum value: 0.0166 (~ 1 minute). Maximum value: 168 (1 week).
        • If no value is specified 1 hour will we used.
      • startDatetime optional - the date and time to from which the interval counts back.
        • This is the date and time closest to now from which you want lead's saved properties. E.g. if you want all lead's saved properties on New Year's Day you could use an interval of 24 plus a startDatetime of 2013-01-01 23:59:59. This will pull data from the very end of the day to 24 hours previous.
        • Format: YYYY-MM-DD hh:mm:ss
        • This method currently assumes the date passed will be UTC
        • If no value is specified the current date/time will be used
      • dateType optional - there are several dates associated with a lead's saved property, this will specify what is being used to return information.
        • Possible Values:
          • created - the date/time the lead's saved property is added to our system.
          • lastEdited - the date/tome the lead's saved property is updated in our system.
        • If no value is specified created will be used.
      • rf optional array of fields to return in the output
        • List of available return fields can be obtained via the listmethods method.
        • rf[]=* or rf=* returns all the available fields in the output
        • Specified fields that are not in the available return fields list will be ignored
    • output: If no property ID is passed all properties are returned. If a property ID is passed only the information for that specified property is returned.
    // access URL and request method
    $url = 'https://api.idxbroker.com/leads/property/1/1?interval=24&startDatetime=2012-01-01+23:59:59&dateType=created';
    $method = 'GET';
    
    // headers (required and optional)
    $headers = array(
    	'Content-Type: application/x-www-form-urlencoded', // required
    	'accesskey: abcdefghijklmnopqrstuvwx', // required - replace with your own
    	'outputtype: json' // optional - overrides the preferences in our API control page
    );
    
    // set up cURL
    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $url);
    curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    
    if ($method != 'GET')
    	curl_setopt($handle, CURLOPT_CUSTOMREQUEST, $method);
    
    // exec the cURL request and returned information. Store the returned HTTP code in $code for later reference
    $response = curl_exec($handle);
    $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    
    if ($code >= 200 || $code < 300)
    	$response = json_decode($response,true);
    else
    	$error = $code;
    											
  • POST

    Update an existing lead's saved property.
    • primary request ID: leadID required The ID of a lead.
    • secondary request ID: propertyID required The ID of a lead's saved property.
    • additional input: optional update fields in a URL encoded, ampersand delineated, query string format
    • output: If no POST data is supplied then a list of updatable fields with format information is returned.
      • Note 1: the property query should be sent as an array. E.G.
        ...&property[idxID]=a001&property[listingID]=1234
      • Note 2: When seeing the list of updatable fields and reference to the size or maxlength of data are for display only. They represent rows and cols respectively and are not an indication of character limit.
    // access URL and request method
    $url = 'https://api.idxbroker.com/leads/property/1/1';
    $data = array(
    	'propertyName'=>'mansion',
    	'property'=>array('idxID'=>'a001','listingID'=>2345678)
    );
    $data = http_build_query($data); // encode and & delineate
    $method = 'POST';
    
    // headers (required and optional)
    $headers = array(
    	'Content-Type: application/x-www-form-urlencoded', // required
    	'accesskey: abcdefghijklmnopqrstuvwx', // required - replace with your own
    	'outputtype: json' // optional - overrides the preferences in our API control page
    );
    
    // set up cURL
    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $url);
    curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    
    if ($method != 'GET')
    	curl_setopt($handle, CURLOPT_CUSTOMREQUEST, $method);
    // send the data
    curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
    
    // exec the cURL request and returned information. Store the returned HTTP code in $code for later reference
    $response = curl_exec($handle);
    $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    
    if ($code >= 200 || $code < 300)
    	$response = json_decode($response,true);
    else
    	$error = $code;
    											
  • PUT

    Create a new lead saved property.
    • primary request ID: leadID required The ID of a lead.
    • secondary request ID: none
    • additional input: optional update fields in a URL encoded, ampersand delineated, query string format
    • output: If a saved property is successfully created the new property's ID will be returned.
      If no PUT data is supplied then a list of updatable fields with format information is returned.
      • Note 1: the property query should be sent as an array. E.G.
        ...&property[idxID]=a001&property[listingID]=1234
      • Note 2: When seeing the list of updatable fields and reference to the size or maxlength of data are for display only. They represent rows and cols respectively and are not an indication of character limit.
    // access URL and request method
    $url = 'https://api.idxbroker.com/leads/property/1';
    $data = array(
    	'propertyName'=>'ruins',
    	'property'=>array('idxID'=>'a001','listingID'=>345678)
    );
    $data = http_build_query($data); // encode and & delineate
    $method = 'PUT';
    
    // headers (required and optional)
    $headers = array(
    	'Content-Type: application/x-www-form-urlencoded', // required
    	'accesskey: abcdefghijklmnopqrstuvwx', // required - replace with your own
    	'outputtype: json' // optional - overrides the preferences in our API control page
    );
    
    // set up cURL
    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $url);
    curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    
    if ($method != 'GET')
    	curl_setopt($handle, CURLOPT_CUSTOMREQUEST, $method);
    // send the data
    curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
    
    // exec the cURL request and returned information. Store the returned HTTP code in $code for later reference
    $response = curl_exec($handle);
    $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    
    if ($code >= 200 || $code < 300)
    	$response = json_decode($response,true);
    else
    	$error = $code;
    											
  • DELETE

    Remove a lead saved property.
    • primary request ID: leadID required The ID of a lead.
    • secondary request ID: propertyID required The ID of the property to delete.
    • additional input: none
    • output: none (204 on success)
    // access URL and request method
    $url = 'https://api.idxbroker.com/leads/property/1/1';
    $method = 'DELETE';
    
    // headers (required and optional)
    $headers = array(
    	'Content-Type: application/x-www-form-urlencoded', // required
    	'accesskey: abcdefghijklmnopqrstuvwx', // required - replace with your own
    	'outputtype: json' // optional - overrides the preferences in our API control page
    );
    
    // set up cURL
    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $url);
    curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    
    if ($method != 'GET')
    	curl_setopt($handle, CURLOPT_CUSTOMREQUEST, $method);
    
    // exec the cURL request and returned information. Store the returned HTTP code in $code for later reference
    $response = curl_exec($handle);
    $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    
    if ($code >= 200 || $code < 300)
    	$response = json_decode($response,true);
    else
    	$error = $code;
    											

Get traffic history for a specified lead during a specified time frame of up to 1 year.

  • GET

    • primary request ID: leadID required The ID of a lead
    • secondary request ID: none
    • additional input:
      • interval optional - the number of hours worth of data to return.
        • This must be a numeric value but can be an integer or a decimal. E.g. to get the last 90 minutes you would use an interval value of 1.5.
          • Up to 4 digits after the decimal point will be tolerated, additional precision will be rounded off.
          • Intervals will also be rounded to the nearest second.
        • The interval specifies the number of hours before the startDatetime from which lead traffic history will be returned.
        • Minimum value: 0.0166 (~ 1 minute). Maximum value: 168 (1 week).
        • If no value is specified 1 hour will we used.
      • startDatetime optional - the date and time to from which the interval counts back.
        • This is the date and time closest to now from which you want lead traffic history. E.g. if you want all lead traffic history created on New Year's Day you could use an interval of 24 plus a startDatetime of 2013-01-01 23:59:59. This will pull data from the very end of the day to 24 hours previous.
        • Format: YYYY-MM-DD hh:mm:ss
        • This method currently assumes the date passed will be UTC
        • If no value is specified the current date/time will be used
      • rf optional array of fields to return in the output
        • List of available return fields can be obtained via the listmethods method.
        • rf[]=* or rf=* returns all the available fields in the output
        • Specified fields that are not in the available return fields list will be ignored
    • output: the applicable client account ID, date, lead ID, IP , page, referrer
    • note: For bandwidth and memory considerations there is a limit of 5,000 on the number of lead traffics that can be returned in any single request.
    // access URL and request method
    $url = 'https://api.idxbroker.com/leads/leadtraffic/1?interval=24&startDatetime=2012-01-01+23:59:59';
    $method = 'GET';
    
    // headers (required and optional)
    $headers = array(
    	'Content-Type: application/x-www-form-urlencoded', // required
    	'accesskey: abcdefghijklmnopqrstuvwx', // required - replace with your own
    	'outputtype: json' // optional - overrides the preferences in our API control page
    );
    
    // set up cURL
    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $url);
    curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    
    // exec the cURL request and returned information. Store the returned HTTP code in $code for later reference
    $response = curl_exec($handle);
    $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    
    if ($code >= 200 || $code < 300)
    	$properties = json_decode($response,true);
    else
    	$error = $code;
    											
  • POST None

  • PUT None

  • DELETE None