Energy Leads

The Energy enpoints allow you as a Publisher to post Energy leads directly to Bright Horizons Media. Leads sent to the API use the POST method and require both credentials and your Publisher to be enabled for posting Energy leads. Leads are posted in JSON format.

Type Endpoint Endpoint Type
Ping https://api.brighthorizonsmedia.com/ping/energy/ JSON
Post https://api.brighthorizonsmedia.com/post/energy/ JSON

POST PARAMETERS

To successfully post Energy leads, two arrays need to be passed to the JSON endpoint: the xauth[] array and the transaction[] array.

The xauth[] array contains your Publisher ID and the API key assigned by your Account Manager.

The transaction[] contains all the details about the lead (first name, last name, email, consumer IP, etc.).

xauth[] Parameters

Field Type Required? Description
affiliateid INT Yes Your Publisher Id (aka Affiliate Id) provided by your Account Manager
key STRING (36) Yes The API Key provided by your Account Manager.

transaction[] Parameters

Field Type Required? Description
firstname STRING Yes First name as provided by the consumer
lastname STRING Yes Last name as provided by the consumer
email STRING Yes Email address as provided by the consumer
phone STRING Yes Phone number as provided by the consumer. Can be passed in any format (see following examples) but must be a valid phone number with 10 digits. Examples: 3105551212, (310) 555-1212, 310-555-1212, 310.555.1212.
address STRING Yes Street address as provided by the consumer
city STRING Optional City as provided by the consumer. If not provided, we will map the city based on the zip code provided.
state CHAR (2) Optional The state abbreviation as provided by the consumer. If not provided, we will map the state based on the zip code provided.
zip STRING Yes The zip code as provided by the consumer. For US zip codes, make sure to include any leading zeros to ensure the zip code has a length of 5 characters.
dob STRING OPTIONAL Date of Birth as provided by the consumer. Must be in the format YYYY-MM-DD.
ip STRING Yes The IP address of the consumer when the form was submitted on your website (not your server IP address). Can be either IPV4 or IPv6.
source STRING Yes The fully qualified URL of the webpage where the lead was generated (excluding any query string parameters)
sub1 STRING Yes Additional field for tracking purposes
sub2 STRING Optional Additional field for tracking purposes
sub3 STRING Optional Additional field for tracking purposes
sub4 STRING Optional Additional field for tracking purposes
sub5 STRING Optional Additional field for tracking purposes
trustedformcertid STRING Yes (see notes) Energy Leads must contain at least 1 (one) of TrustForm Certification URL or Jornaya LeadId. If neither are passed, the lead will not pass our initial validation and will be rejected.
jornayaleadid STRING Yes (see notes) Energy Leads must contain at least 1 (one) of TrustForm Certification URL or Jornaya LeadId. If neither are passed, the lead will not pass our initial validation and will be rejected.

POST REQUESTS & RESPONSES

SAMPLE POST REQUEST


POST /post/energy/ HTTP/1.1
Host: https://api.brighthorizonsmedia.com
Content-Type: application/json; charset=utf-8
Content-Length: 660

{
  "xauth": {
    "affiliateid": 123456, 
    "key": "96852585-58lk-5g5r-63jk8-25lp2574poiu"
  },
  "transaction": {
    "firstname": "JJ",
    "lastname": "McClure",
    "email": "jjmcclure@example.com",
    "phone": "7025551212",
    "address": "123 Cannonball Lane",
    "city": "Boulder City",
    "state": "NV",
    "zip": 89002,
    "ip": "184.248.249.118",
    "source": "https://www.yourwebsite.com/form/",
    "sub1": "yourSub1",
    "sub2": "",
    "sub3": "",
    "sub4": "",
    "sub5": "",
    "trustedformcertid": "https://cert.trustedform.com/9zz999z999999z99999z9999zz9z99999z9z999z",
    "jornayaleadid": "9ZZZZ999-9999-9ZZZ-Z999-99ZZZ999Z99Z"
  }
}

SAMPLE POST RESPONSE

When a Energy lead is posted to us, a JSON response will be returned containing useful information about whether the lead was accepted and any additional information we can provide. Below is an example of a successful response.

A response with sold = 1 (or "sold":1) means the lead was accepted by a buyer and is billable. Sold = 0 (or "sold":0) is NOT billable.

The "accepted" parameter is not to be used for determining whether a lead is billable.


{
    "validated": 1,
    "accepted": 1,
    "sold": 1,
    "disposition": ,
    "errors": [],
    "messages": [],
    "transactionid": 123456789,
    "leadid": 234567891
}

Field Type Description
validated BOOLEAN Returns true or false if the lead passed validation (i.e. contains first and last name, valid email format, etc.). We do not accept/store leads that can not be validated.
accepted BOOLEAN Returns true if we accepted the lead into our system. Returns false if we did not accept the lead.
sold BOOLEAN Returns true if the lead was successfully sold to a buyer. Returns false if a buyer did not purchase the lead.
disposition STRING May contain additional information such as a generic categorical reason why a lead could not be purchased.
errors ARRAY May contain additional specific information about the lead (such as reasons why we could not validate the lead, etc.)
messages ARRAY May contain additional specific information about the processing of the lead
transactionid INT Returned if we accept a lead into the system (regardless of whether the lead was sold).
leadid INT Returned if we accept a lead into the system (regardless of whether the lead was sold).

FAILED POST RESPONSE

If the request failed, the response will include an errors object which may contain 1 or more error messages. This example will return an error message because the Publisher Id was not passed through the pubid parameter.


{
    "validated": 0,
    "accepted": 0,
    "sold": 0,
    "disposition": ,
    "messages": [
        "Energy Dereg Lead could not be validated"
    ],
    "errors":
    [
        [
            "Invalid authorization",
            "Phone (required): can not be blank"
        ]
    ]
}