Skip to content

Contact Us

This function submits a contact us case to Salesforce Service Console. The organization ID will be determined based on environment, so developers will not need to provide one.

Path

https://api.b-fonline.com/api/contact_us

Method

POST

Required Parameters

  • first_name
  • last_name
  • birth_month
  • birth_day
  • birth_year
  • category ('spirits' or 'wine')
  • email
  • zip_postal
  • country (ISO2 or ISO3 country code)
  • brand_id (find this id from the brands API call)

Optional Parameters

  • source (defaults to 'Brand Website')
  • type (defaults to 'Question')
  • subject
  • 00N1300000B80zB (category, usually a dropdown on the form)
  • city
  • us_state_abbrv (State abbreviation for US consumers)
  • state_prov_terr (State equivalent for non-US consumers)
  • address_1
  • description (The message from the consumer)

Responses

Please note: Salesforce Service Console returns limited data, so our API is unable to validate a case was successfully created. You must have your Brown-Forman contact check Service Console when you are testing this API.

  • 200 LDA = false
    • {"lda":false}
  • 201
    • {"success"}
  • 400 - cURL error or date is invalid
    • {"error": //error message }

Code Examples

$(function() {
  //tested with jQuery 1.12.4, 2.2.4, 3.3.1 
  var data = {
    "first_name": "Testfirst",
    "last_name": "Testfirst",
    "birth_day": "04",
    "birth_month": "07",
    "birth_year": "1956",
    "email": "[email protected]",
    "zip_postal": "40210",
    "source": "Brand Website",
    "brand_id": "17",
    "category": "spirits",
    "type": "Question",
    "subject": "Old Forester Contact Us",
    "address_1": "100 Example Street",
    "city": "Louisville",
    "us_state_abbrv": "KY",
    "country": "USA",
    "description": "Testing the contact us form.",
    "00N1300000B80zB": "Brand Enquiry"
  };

  var settings = {
    url: 'https://staging-api.b-fonline.com/api/contact_us',
    method: 'POST',
    data: JSON.stringify(data),
    contentType: 'application/json',
    dataType: 'json'
  };  

  $.ajax(settings).done(function(response){
    console.log(response);
  });

});