Ejemplos de JSONLead

Embedding a JSONLead in a HTML Email

It is a best practice to surround the JSONLead with a div with the attribute id=”jsonlead” (i.e <div id=”jsonlead“>). This allows JSONLead parsers to easily retrieve the DOM element containing the JSONLead.

<html> <body> <h3>Customer Data:</h3> <ul> <li>Name: John Doe</li> <li>Email: johndoe@example.com</li> <li>Phone Number: (555) 555-5555</li> </ul> <h3>Vehicle:</h3> <ul> <li>Make: Toyota</li> <li>Model: Corolla</li> <li>Version: VVTI</li> <li>Year: 2006</li> <li>Horsepower: 110</li> <li>Url: https://www.mydealerwebsite.com/toyota-corolla-2006-gasoline-vvti.html</li> </ul> <h3>Customer inquiry</h3> <p> Hi, is this vehicle still available? </p> <div id="jsonlead">
{
   "version": "1.0.0",
   "client": {
      "first_name": "John",
      "last_name": "Doe",
      "email": "johndoe@example.com",
      "phone": "(555) 555-5555"
   },
   "sales_lead": {
      "car": {
         "make": "Toyota",
         "model": "Corolla",
         "version": "VVTI",
         "year": 2006,
         "horsepower": 110,
         "url": "https://www.mydealerwebsite.com/toyota-corolla-2006-gasoline-vvti.html"
      },
      "inquiry": "Hi, is this vehicle still available?"
   }
}
</div> </body> </html>

Embedding a JSONLead in a plain-text Email

In plain text, JSONLead needs to be surrounded by the tag  “[jsonlead]”. This allows JSONLead parsers to easily retrieve the DOM element containing the JSONLead.

Customer: Name: John Doe Email: johndoe@example.com Phone: (555) 555-5555 Interested in Vehicle: Make: Toyota Model: Corolla Version: VVTI Year: 2006 Horepower: 110 Url: https://www.mydealerwebsite.com/toyota-corolla-2006-gasoline-vvti.html Customer inquiry: Hi, is this vehicle still available? [jsonlead]
{
   "version": "1.0.0",
   "client": {
      "first_name": "John",
      "last_name": "Doe",
      "email": "johndoe@example.com",
      "phone": "(555) 555-5555"
   },
   "sales_lead": {
      "car": {
         "make": "Toyota",
         "model": "Corolla",
         "version": "VVTI",
         "year": 2006,
         "horsepower": 110,
         "url": "https://www.mydealerwebsite.com/toyota-corolla-2006-gasoline-vvti.html"
      },
      "inquiry": "Hi, is this vehicle still available?"
   }
}
[jsonlead]

Including custom fields within a JSONLead

To include a custom field that is not part of the JSONLead Schema use the custom key whose value will be an JSON. The values allowed in the custom object can only be one of the following: String, Array, Numbers –objects are not permited within the custom object.
Here is an example of how to add a pet’s name as a custom of “customer” and the id from a DMS inside the Sales Lead.

{
   "client": {
      "first_name": "John",
      "custom": {
         "Pets_name": "Lassie"
      }
   },
   "sales_lead": {
      "car": {
         "make": "Ford"
      },
      "custom": {
         "DMS_id": "A12345X"
      }
   },
   "version": "1.0.0"
}

JSONLead - Lead with appointments

Include a service or lead appointment within the lead document like so:
Note: Dates are in ISO Date 8601

{
   "client": {
      "first_name": "John"
   },
   "sales_lead": {
      "car": {
         "make": "Ford"
      },
      "appointment": {
         "custom": {},
         "due_date": "2020-11-07T19:14:00.000Z",
         "assigned_to": "johndoe@example.com"
      }
   },
   "version": "1.0.0"
}

JSONLead - Lead with a task

You can specify tasks to be associated with a lead like so:

{
   "client": {
      "first_name": "John"
   },
   "sales_lead": {
      "car": {
         "make": "Ford"
      },
      "task": {
         "due_date": "2020-11-17T17:08:00.000Z",
         "assigned_to": "johndoe@example.com",
         "description": "Follow up call"
      }
   },
   "version": "1.0.0"
}

JSONLead as a payload API

Some Lead Managers implement an API endpoint to parse  JSONLead’s. Simple send the JSONLead as the payload of a POST HTTP Request. Here is a curl example:

curl -d '{"client": {"first_name": "John"},"sales_lead": \
{"car": {"make" : "Ford"}},"version": "1.0.0"}' \
-H "Content-Type: application/json" \
-X POST http://www.exampleCRM.com/saveLead

Created with the purpose of simplifying life

es_ESSpanish