Javascript API (posting Web Forms using Javascript)


ActiveDEMAND has a javascript api that allows for posting to a web form using java script. 


Step 1: create your form in ActiveDEMAND

Step 2:  add the access javascript to the pages that have an existing form that you want to post data to ActiveDEMAND (see below)


Those form pages that have existing forms and the javascript below will post the form data to ActiveDEMAND whenever a form is submitted. Place this script anywhere after the default ActiveDEMAND tracking script is inserted. (note, this script requires the default tracking script included on the page)


  

<script type="text/javascript">
    var i = setInterval(function () {
        if (typeof AD !== 'undefined') {
            clearInterval(i);
            AD.ready(function () {
                AD.submit_ad_form(<ActiveDEMAND Form ID>,, {
                    data: ["input-selecter-1", "input-selector-2", "input-selector-3"],
                    form_selector: "form-selector"
                });
            });
        }
    }, 300);
</script>

  



Examples:


Example 1: ID Referenced Inputs

Given this form:

 

<form accept-charset="UTF-8" action="/contact" class="contact-form" method="post">
 <input name="form_type" type="hidden" value="contact">
 <input name="utf8" type="hidden" value="?">

  <p>
  <label>
  Your Name:
  </label>
  <br>
  <input type="text" id="contactFormName" name="contact[name]" placeholder="John Doe">
  </p>
  <p>
  <label>
  Email:
  </label>
  <br>
  <input type="email" id="contactFormEmail" name="contact[email]" placeholder="john@example.com">
  </p>
  <p>
  <label>
  Phone Number:
  </label>
  <br>
  <input type="telephone" id="contactFormTelephone" name="contact[phone]" placeholder="555-555-1234">
  </p>
  <p>
  <label>
  Message:
  </label>
  <br>
  <textarea rows="15" cols="75" id="contactFormMessage" name="contact[body]" placeholder="Your Message"></textarea>
  </p>
  <p>
  <input type="submit" id="contactFormSubmit" value="Send" class="btn">
  </p>
</form>

 

This is the script you would put in:

  

<script type="text/javascript">
     var i = setInterval(function () {
         if (typeof AD !== 'undefined') {
             clearInterval(i);
             AD.submit_ad_form(12345, {
                 data: ["input#contactFormName", "input#contactFormEmail", "input#contactFormTelephone", "input#contactFormMessage"],
                 form_selector: "form.contact-form"
             });
         }
     }, 300);
 </script>

  


Example 2: Name Referenced inputs

Given this form:

  

<form name="" action="/contact-us/#wpcf7-f190-p377-o1" method="post" class="wpcf7-form" novalidate="novalidate">
<p>Name <input type="text" name="your-name" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required" aria-required="true" aria-invalid="false"></p>
<p>Email<input type="email" name="your-email" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-email wpcf7-validates-as-required wpcf7-validates-as-email" aria-required="true" aria-invalid="false"></p>
<p>Phone Number <input type="tel" name="phone" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-tel wpcf7-validates-as-tel" aria-invalid="false"></p>
<p>Company <input type="text" name="company" value="" size="40" class="wpcf7-form-control wpcf7-text" aria-invalid="false"></p>
<p><textarea name="Comments" cols="40" rows="10" class="wpcf7-form-control wpcf7-textarea" aria-invalid="false" placeholder="COMMENTS"></textarea></p>
<p><input type="submit" value="Send" class="wpcf7-form-control wpcf7-submit"><img class="ajax-loader" src="http://podmarketinginc.com/wp-content/plugins/contact-form-7/images/ajax-loader.gif" alt="Sending ..." style="visibility: hidden;"></p>
<div class="wpcf7-response-output wpcf7-display-none"></div></form> 

  


This is your code


  

<script type="text/javascript">
     var i = setInterval(function () {
         if (typeof AD !== 'undefined') {
             clearInterval(i);
             AD.ready(function () {
                 AD.submit_ad_form(12345, {
                     data: ["input#contactFormName", "input#contactFormEmail", "input#contactFormTelephone", "input#contactFormMessage"],
                     form_selector: "form.contact-form"
                 });
             });
         }
     }, 300);
 </script>

  


You can also use this script to post the data to ActiveDEMAND immediately (as opposed to when the form submits).  You would use this when you have the raw data that needs to be submitted and want to submit it during some other point in the user flow.

  

<script type="text/javascript">
     var i = setInterval(function () {
         if (typeof AD !== 'undefined') {
             clearInterval(i);
             AD.ready(function () {
                 AD.submit_ad_form(1234, {data: ["Test Person", "test.person@test.com", "1112221212", "Test Company", "Some extra comments"]});
             });
         }
     }, 300);
 </script>

  


Updating Contact details via the Javascript API


ActiveDEMAND has a javascript api that allows for updating a contact's details.  You would use this in the situation where you know who the contact is, and want to update that information in ActiveDEMAND.


You would use the following javascript to post the available data to ActiveDEMAND.  All fields are optional, any data you send will be updated on the current contact who is visiting the page this script runs on.


  

<script type="text/javascript">
    var data = {
        email_address: 'j.test@test.com',
        first_name: 'Jane',
        last_name: 'Test',
        full_name: 'Jane Test',
        title: 'CEO',
        employer: 'Test Company Inc',
        phone: '1112221212'
    }
    AD.update_contact(data);
</script>

  



Web API (ActiveDEMAND API Endpoint Reference)

Note: The Web API requires an API key. Read this to find where the key is located.


ActiveDEMAND implements the following endpoints for integrating with external services. All endpoints require an API key.


API Base URL:  

 

https://api.activedemand.com

 

The ActiveDEMAND account API key can be passed in the X-Api-Key request header field: 

 

X-Api-Key: <API-KEY>

 

Or as a parameter named api-key:

 

https://api.activedemand.com/<endpoint>?api-key=<API-KEY>

 


Form Endpoints

GET /v1/forms 

List all available web forms for the ActiveDEMAND account.


Examples:

https://api.activedemand.com/v1/forms.json?api-key={API_KEY}


[
  {
    "id": 1,
    "name": "Form 1"
  },
  {
    "id": 2,
    "name": "Form 2"
  }
]

 

https://api.activedemand.com/v1/forms.xml?api-key={API_KEY}

 

<forms type="array">
  <form>
    <id type="integer">1</id>
    <name>Form 1</name>
  </form>
  <form>
    <id type="integer">2</id>
    <name>Form 2</name>
  </form>
</forms>

 


GET /v2/forms/fields?form_id={form_id} 


Lists the fields in a given form. If no form ID is supplied, then all available fields are returned.

Examples:

https://api.activedemand.com/v1/forms/fields.json?form_id={form_id}&api-key={API-KEY}


 

[
  {
    "type": "unicode",
    "key": "field_1",
    "required": false,
    "label": "First Name"
  },
  {
    "type": "unicode",
    "key": "field_11",
    "required": false,
    "label": "Last Name"
  },
  {
    "type": "unicode",
    "key": "field_21",
    "required": true,
    "label": "Email Address"
  }
]

 

https://api.activedemand.com/v1/forms/fields.xml?form_id={form_id}&api-key={API-KEY}

 

<objects type="array">
  <object>
    <type>unicode</type>
    <key>field_1_0</key>
    <required type="boolean">false</required>
    <label>First Name</label>
  </object>
  <object>
    <type>unicode</type>
    <key>field_11_1</key>
    <required type="boolean">false</required>
    <label>Last Name</label>
  </object>
  <object>
    <type>unicode</type>
    <key>field_21_2</key>
    <required type="boolean">true</required>
    <label>Email Address</label>
  </object>
</objects>

 


GET /v1/forms/{form_id}


Returns the HTML/styles for the given form. The returned value can be inserted directly into a landing page. 


Example: 

https://api.activedemand.com/v1/forms/{form_id}?api-key={API-KEY

 

<style type='text/css'>
  /* form styles */
</style>
<div class='activedemand-wrapper label-placement-top' id='fb3cd25b4c6e66099'>
  <h3>Form Title</h3>
  <p>Some form introduction</p>
  <form action='https://submit.activedemand.com/submit/form/1' 
method='post'  
class='activedemand activedemand-cta'>
    <div class='form'>
      <div class='form_label input-label'>
        <label for='form_1_0'>First Name</label> 
      </div>
      <div class='form_input'>
        <input  type='text' id='form_1_0' name='form[1_0]' >
      </div>
      <div class='form_label input-label'>
        <label for='form_11_1'>Last Name</label> 
      </div>
      <div class='form_input'>
        <input  type='text' id='form_11_1' name='form[11_1]' >
      </div>
      <div class='form_label input-label'>
        <label for='form_21_2'>Email Address <span class='required'>*</span></label> 
      </div>
      <div class='form_input'>
        <input type='text' id='form_21_2' name='form[21_2]' class='required' >
      </div>

      <div class='activedemand-button-container'>
        <button class='activedemand-button btn'>Submit</button>
  </div>
    </div>
  </form>
</div>



POST /v1/forms/{form_id} 

Submit a form with the posted values. If the form_id is not present, it submits as an unknown form.


Example:


https://api.activedemand.com/v1/forms/{form_id}?api-key={API-KEY}

Parameters:

 

{
  "field_1": "John",
  "field_11": "Doe",
  "field_21": "john.doe@example.com"
}

 


Dynamic Block Endpoints 



GET /v1/smart_blocks

List all available dynamic blocks for the ActiveDEMAND account.


Examples:

https://api.activedemand.com/v1/smart_blocks.json?api-key={API_KEY}

 

[
  {
    "id": 1,
    "name": "Dynamic Block 1"
  },
  {
    "id": 2,
    "name": "Dynamic Block 2"
  }
]

 

https://api.activedemand.com/v1/forms.xml?api-key={API_KEY}

 

<dynamic-contents type="array">
  <dynamic-content>
    <id type="integer">1</id>
    <name>Dynamic Block 1</name>
  </dynamic-content>
  <dynamic-content>
    <id type="integer">2</id>
    <name>Dynamic Block 2</name>
  </dynamic-content>
</dynamic-contents>

 

GET /v1/smart_blocks/{block_id} 

Returns the HTML/styles for the given dynamic block. The returned value can be inserted directly into a landing page.


Example:

https://api.activedemand.com/v1/smart_blocks/{block_id}?api-key={API-KEY}

 

<div class='activedemand'>
  <style type='text/css'>
    /* dynamic block styles */
  </style>
  <div class='activedemand-smart-block-wrapper' id='dc70165019658700'>
    <div class='activedemand-smart-block'>
      <!-- dynamic block content -->
    </div>
  </div>
</div>
<script type='text/javascript'>
  /* dynamic block scripts */
</script>

 


Contact Endpoints 

GET /v1/contacts 
Get a list of all your contacts. This endpoint is paged with a max of 500 contacts returned at one time.
Parameters:
•         page: default 0
•         limit: default 100, max 500
•         search_term: text to search for (contact name, email, phone number, account name, etc)
•         search_list_id:  ID of a contact list, this will return all contacts in this list
•         search_tag: returns all contacts with this tag
•         order_by: can be created, or updated and defaults to created
•         order: asc or desc, defaults to desc
•         created_by: only return contacts created on or after this datetime (format should be yyyy-mm-dd hh:mm:ss, ei 2017-07-28 19:00:27)
•         updated_by: only return contacts updated on or after this datetime (format should be yyyy-mm-dd hh:mm:ss, ei 2017-07-28 19:00:27)

Example:
https://api.activedemand.com/v1/contacts.json?api-key={API-KEY}


[{
    "id": 1326622,
    "contact.edit_link": "https://jumpdemand.activedemand.com/contacts/1326622/edit",
    "contact.call_link": "https://jumpdemand.activedemand.com/contacts/1326622/edit?call=true",
    "lead_score.lead_score": 100,
    "first_name": "First",
    "last_name": "Last",
    "full_name": "First Last",
    "title": null,
    "contact_source_name": "Live Chat",
    "contact_source_description": "http://www.jumpdemand.com/",
    "industry_list": null,
    "tag_list": null,
    "opted_in": "No",
    "unsubscribed": "No",
    "claimed_by_id": null,
    "dni_list": "No",
    "addresses.address": null,
    "addresses.city": "Calgary",
    "addresses.province": "AB",
    "addresses.postal_code": null,
    "addresses.country": "CA",
    "phones.phone_number": "1112221212",
    "emails.email_address": "first.last@jumpdemand.com",
    "social_media_accounts.username": null,
    "accounts.business_name": "ActiveDEMAND",
    "accounts.addresses.address": null,
    "accounts.addresses.city": "Calgary",
    "accounts.addresses.province": "AB",
    "accounts.addresses.postal_code": "T3G 2P6",
    "accounts.addresses.country": "CA",
    "accounts.phones.phone_number": "8006584305",
    "accounts.emails.email_address": "info@activedemand.com",
    "accounts.website.url": "https://www.activedemand.com",
    "accounts.claimed_by_id": null,
    "custom_521": null,
    "custom_549": "Agency",
}]



GET /v1/contacts/fields 

Lists all available contact fields.


Examples:

https://api.activedemand.com/v1/contacts/fields.json?api-key={API-KEY}

  

[
  {
    "type": "unicode",
    "key": "contact[first_name]",
    "required": false,
    "label": "First Name"
  },
  {
    "type": "unicode",
    "key": "contact[last_name]",
    "required": false,
    "label": "Last Name"
  },
  {
    "type": "unicode",
    "key": "contact[emails.email_address]",
    "required": true,
    "label": "Email Address"
  },
  {
    "type": "unicode",
    "key": "contact[custom_53]",
    "required": false,
    "label": "Custom Field 1",
    "list": false,
    "choices": ["field 3", "field 4"]
  }
 /* all other contact fields */
] 

  


https://api.activedemand.com/v1/contacts/fields.xml?api-key={API-KEY} 

  

<objects type="array">
  <object>
    <type>unicode</type>
    <key>contact[first_name]</key>
    <required type="boolean">false</required>
    <label>First Name</label>
  </object>
  <object>
    <type>unicode</type>
    <key>contact[last_name]</key>
    <required type="boolean">false</required>
    <label>Last Name</label>
  </object>
  <object>
    <type>unicode</type>
    <key>contact[custom_53]</key>
    <required type="boolean">false</required>
    <label>Custom Field 1</label>
    <list type="boolean">false</list>
    <choices type="array">
      <choice>field 3</choice>
      <choice>field 4</choice>
    </choices>
  </object>
<!-- all other contact fields -->
</objects> 

  

POST /v1/contacts 

Create or update a contact. The email address will be used to lookup an existing contact (if present) and is required.


Example:

https://api.activedemand.com/v1/contacts?api-key={API-KEY}

Parameters:

 

{
  "contact[first_name]": "John",
  "contact[last_name]": "Doe",
  "contact[emails.email_address]": "john.doe@example.com",
  "contact[custom_53]": "field 3"
}


PUT /v1/contacts/{CONTACT-ID} 

Update a contact based on an ID. The ID will be used to lookup an existing contact and is required.


Example:

https://api.activedemand.com/v1/contacts/{CONTACT-ID}?api-key={API-KEY}

Parameters:

 

{
  "contact[first_name]": "John",
  "contact[last_name]": "Doe",
  "contact[emails.email_address]": "john.doe@example.com",
  "contact[custom_53]": "field 3"
}

 

GET /v1/contacts 

Retrieve a contact. The id will be used to lookup an existing contact and is required.


Example:

https://api.activedemand.com/v1/contacts/{CONTACT-ID}?api-key={API-KEY}


History Endpoints

GET /v1/histories
Get a list of all contact histories. This endpoint is paged with a max of 500 histories returned at one time.
Parameters:
•         page: default 0
•         limit: default 100, max 500
•         search_term: text to search for (contact name, email, phone number, account name, etc)
•         campaign_id:  get only histories associated with this campaign
•         contact_id: get only histories associated with this contact
•         start_date: get only histories created on or after this date (format should be yyyy-mm-dd hh:mm:ss, ei 2017-07-28 19:00:27)
•         end_date: get only histories on or before this date (format should be yyyy-mm-dd hh:mm:ss, ei 2017-07-28 19:00:27)
•         history_type: types of histories to to return, blank will return all (eg 'SubmittedForm,Email Log,EmailOpen')

Example:
https://api.activedemand.com/v1/histories.json?api-key={API-KEY}


[
        {
            "id": 89841825,
            "history_type": "SiteVisit",
            "created_at": "2018-02-12 22:54:23",
            "utm_medium": "email",
            "utm_source": "fake-account",
            "utm_campaign": "fake-account",
            "session": {
                "entry_page": "http://jumptest.jumpdemand.net/?utm_source=fake-account&amp;amp;utm_medium=email&amp;amp;utm_campaign=fake-account&amp;amp;activedemand_reference=89841711&amp;amp;chid=89826700&amp;amp;sid=409221811",
                "ip_address": "185.102.239.179"
            },
            "pages": ["http://jumptest.jumpdemand.net/?utm_source=fake-account&amp;amp;utm_medium=email&amp;amp;utm_campaign=fake-account&amp;amp;activedemand_reference=89841711&amp;amp;chid=89826700&amp;amp;sid=409221811", "http://jumptest.jumpdemand.net/?utm_source=fake-account&amp;amp;utm_medium=email&amp;amp;utm_campaign=fake-account&amp;amp;activedemand_reference=89843215&amp;amp;chid=89843181&amp;amp;sid=409378472"],
            "contact": {
                "id": 1326622,
                "contact.edit_link": "https://jumpdemand.activedemand.com/contacts/1326622/edit",
                "contact.call_link": "https://jumpdemand.activedemand.com/contacts/1326622/edit?call=true",
                "lead_score.lead_score": 100,
                "first_name": "First",
                "last_name": "Last",
                "full_name": "First Last",
                "title": null,
                "contact_source_name": "Live Chat",
                "contact_source_description": "http://www.jumpdemand.com/",
                "industry_list": null,
                "tag_list": null,
                "opted_in": "No",
                "unsubscribed": "No",
                "claimed_by_id": null,
                "dni_list": "No",
                "addresses.address": null,
                "addresses.city": "Calgary",
                "addresses.province": "AB",
                "addresses.postal_code": null,
                "addresses.country": "CA",
                "phones.phone_number": "1112221212",
                "emails.email_address": "first.last@jumpdemand.com",
                "social_media_accounts.username": null,
                "accounts.business_name": "ActiveDEMAND",
                "accounts.addresses.address": null,
                "accounts.addresses.city": "Calgary",
                "accounts.addresses.province": "AB",
                "accounts.addresses.postal_code": "T3G 2P6",
                "accounts.addresses.country": "CA",
                "accounts.phones.phone_number": "8006584305",
                "accounts.emails.email_address": "info@activedemand.com",
                "accounts.website.url": "https://www.activedemand.com",
                "accounts.claimed_by_id": null,
                "custom_521": null,
                "custom_549": "Agency",
            },
            "contact_group": "managed"
        }
    ]




GET /histories/history_types 

Get a list of available history types that can be created. 


Example:

https://api.activedemand.com/v1/histories/history_types?api-key={API-KEY} 

 

[
  {
    "id": "WonDeal",
    "history_type": "Deal Won / Item Purchased"
  }
]

 


GET /histories/fields?history_type={history_type} 

List the available fields that can be supplied when creating the history record. This may change depending on the history type.


Example:

https://api.activedemand.com/v1/histories/fields?history_type=WonDeal&api-key={API-KEY}

 

[
  {
    "type": "unicode",
    "key": "field_1",
    "required": false,
    "label": "First Name"
  },
  {
    "type": "unicode",
    "key": "field_11",
    "required": false,
    "label": "Last Name"
  },
  {
    "type": "unicode",
    "key": "field_21",
    "required": true,
    "label": "Email Address"
  },
  /* all other fields */
  {
    "type": "unicode",
    "key": "name",
    "required": true,
    "label": "Description"
  },
  {
    "type": "decimal",
    "key": "deal_value",
    "required": true,
    "label": "Value"
  }
]

 

POST /histories 

Create a history record. This may create a contact, or add the history record to an existing contact if possible. Contacts are looked up with the email address field which is required.  


Example:

https://api.activedemand.com/v1/histories?api-key={API-KEY}


Parameters:

 

{
  "field_1": "John",
  "field_11": "Doe",
  "field_21": "john.doe@example.com",
  "name": "Deal Name",
  "deal_value": "324.56",
  "history_type": "WonDeal"
}

 



Web Hooks

Web hooks are used to subscribe to ActiveDEMAND events. The events are currently limited to new contacts being created, and new contact histories being created.


GET /web_hooks

List all web hooks for your account.


Example:

https://api.activedemand.com/v1/web_hooks?api-key={API-KEY}


POST /web_hooks

Subscribe to an event web hook. An event, target url, and optionally an event argument are required. The subscription ID is returned and can be used to unsubscribe from the web hook.


The possible events are:

  • new_contact: posts when a new contact is added to ActiveDEMAND
  • updated_contact: posts when an existing contact is updated in ActiveDEMAND
  • new_history: posts when a new history item is added to ActiveDEMAND, possible history types are: 
    • EmailLinkClick
    • EmailOpen
    • Email Log
    • Live Chat
    • PhoneCall
    • SiteVisit
    • SubmittedForm
    • TextMessage
    • WonDeal
    • Unsubscribe

Example:

https://api.activedemand.com/v1/web_hooks?api-key={API-KEY}

Parameters (callback on a won deal):

 

{
  "event": "new_history",
  "event_argument": "WonDeal",
  "target_url": "https://your.callback.com"
}

 


Parameters (callback on a new contact):

 

{
  "event": "new_contact",
  "event_argument": "",
  "target_url": "https://your.callback.com"
}

 


Parameters (callback on a updated contact):

 

{
  "event": "updated_contact",
  "event_argument": "",
  "target_url": "https://your.callback.com"
}

 


DELETE /web_hooks

Unsubscribe from an event web hook. The ID of the subscription is required, or the target url or event you wish to unsubscribe from. If your target url returns a 410 response code, it will automatically be unsubscribed.


Example:

https://api.activedemand.com/v1/web_hooks?api-key={API-KEY}


Parameters (unsubscribe from a specific web hook subscription):

{
  "id": "1234"
}

 

Parameters (unsubscribe from all new_contact subscriptions to a specific target url): 

{
  "event": "new_contact",
  "target_url": "https://your.callback.com"
}

 

Parameters (unsubscribe from all won deal subscriptions):

{
  "event": "new_history",
  "event_argument": "WonDeal"
}

 

Parameters (unsubscribe from all subscriptions owned by your account):  

{

} 

   


Example Data

What gets posted to your target url is dependent the event.


New Contact

[{
    "id": 1326622,
    "contact.edit_link": "https://jumpdemand.activedemand.com/contacts/1326622/edit",
    "contact.call_link": "https://jumpdemand.activedemand.com/contacts/1326622/edit?call=true",
    "lead_score.lead_score": 100,
    "first_name": "First",
    "last_name": "Last",
    "full_name": "First Last",
    "title": null,
    "contact_source_name": "Live Chat",
    "contact_source_description": "http://www.jumpdemand.com/",
    "industry_list": null,
    "tag_list": null,
    "opted_in": "No",
    "unsubscribed": "No",
    "claimed_by_id": null,
    "dni_list": "No",
    "addresses.address": null,
    "addresses.city": "Calgary",
    "addresses.province": "AB",
    "addresses.postal_code": null,
    "addresses.country": "CA",
    "phones.phone_number": "1112221212",
    "emails.email_address": "first.last@jumpdemand.com",
    "social_media_accounts.username": null,
    "accounts.business_name": "ActiveDEMAND",
    "accounts.addresses.address": null,
    "accounts.addresses.city": "Calgary",
    "accounts.addresses.province": "AB",
    "accounts.addresses.postal_code": "T3G 2P6",
    "accounts.addresses.country": "CA",
    "accounts.phones.phone_number": "8006584305",
    "accounts.emails.email_address": "info@activedemand.com",
    "accounts.website.url": "https://www.activedemand.com",
    "accounts.claimed_by_id": null,
    "custom_521": null,
    "custom_549": "Agency",
}]

 

Updated Contact

[{
    "id": 1326622,
    "contact.edit_link": "https://jumpdemand.activedemand.com/contacts/1326622/edit",
    "contact.call_link": "https://jumpdemand.activedemand.com/contacts/1326622/edit?call=true",
    "lead_score.lead_score": 100,
    "first_name": "First",
    "last_name": "Last",
    "full_name": "First Last",
    "title": null,
    "contact_source_name": "Live Chat",
    "contact_source_description": "http://www.jumpdemand.com/",
    "industry_list": null,
    "tag_list": null,
    "opted_in": "No",
    "unsubscribed": "No",
    "claimed_by_id": null,
    "dni_list": "No",
    "addresses.address": null,
    "addresses.city": "Calgary",
    "addresses.province": "AB",
    "addresses.postal_code": null,
    "addresses.country": "CA",
    "phones.phone_number": "1112221212",
    "emails.email_address": "first.last@jumpdemand.com",
    "social_media_accounts.username": null,
    "accounts.business_name": "ActiveDEMAND",
    "accounts.addresses.address": null,
    "accounts.addresses.city": "Calgary",
    "accounts.addresses.province": "AB",
    "accounts.addresses.postal_code": "T3G 2P6",
    "accounts.addresses.country": "CA",
    "accounts.phones.phone_number": "8006584305",
    "accounts.emails.email_address": "info@activedemand.com",
    "accounts.website.url": "https://www.activedemand.com",
    "accounts.claimed_by_id": null,
    "custom_521": null,
    "custom_549": "Agency",
}]

 

New History – SubmittedForm 

[{
    "id": 20215118,
    "history_type": "SubmittedForm",
    "created_at": "2016-06-29 15:48:52",
    "form_id": 7831,
    "form_name": "schedule appointment",
    "fields": [
        ["First Name", "First"],
        ["Last Name", "Last"],
        ["Checkbox", "1"],
        ["Email Address", "first.last@jumpdemand.com"],
        ["Label Text", "yes"],
        ["Phone Number", "1112221212"],
        ["Long Answer", "Testing"]
    ],
    "contact": {} /* contact json structure */
}]

 


New History – Live Chat 

[{
    "id": 20992954,
    "history_type": "Live Chat",
    "created_at": "2016-07-14 20:08:42",
    "transcript": "chat transcript",
    "contact": {} /* contact json structure */
}]

 

New History – EmailLinkClick

[{
    "id": 21545324,
    "history_type": "EmailLinkClick",
    "created_at": "2016-07-25 19:53:13",
    "url": "http://www.activedemand.com",
    "subject_line": "Subject",
    "contact": {} /* contact json structure */
}]

 


New History – EmailOpen

[{
    "id": 21736868,
    "history_type": "EmailOpen",
    "created_at": "2016-07-29 15:00:43",
    "open_tag_type": "image",
    "subject_line": "Email Subject Line,
    "contact": {} /* contact json structure */
}]

 

New History – PhoneCall

[{
    "id": 17289272,
    "history_type": "PhoneCall",
    "created_at": "2016-05-18 15:45:33",
    "to": "+11112221212",
    "caller_name": "Cell Phone   AB",
    "from": "+11112221212",
    "from_city": "",
    "from_country": "CA",
    "from_state": "Alberta",
    "from_zip": "",
    "transcript": "Phone call transcript (if available)",
    "contact": {} /* contact json structure */
}]

 


New History – TextMessage

[{
    "id": 6549484,
    "history_type": "TextMessage",
    "created_at": "2015-07-14 00:10:10",
    "message": "This is another test message, with another link that you should consider clicking on: http://1jp.cc/s/SaCsP",
    "to": "+11112221212",
    "from": "+11112221212",
    "from_city": null,
    "from_country": null,
    "from_state": null,
    "from_zip": null,
    "contact": {} /* contact json structure */
}]

 

New History – WonDeal

[{
    "id": 9836627,
    "history_type": "WonDeal",
    "created_at": "2015-11-27 14:31:55",
    "name": "won deal details",
    "value": null,
    "contact": {} /* contact json structure */
}]