Resources

API Reference

Lead creation object

Note:

The following object includes all possible keys in the lead creation object.

{ 
    "organizationID": "", 
    // locatorID, locationSearch are only needed if creating a lead without and organizationID
    "locatorID": "", 
    "locationSearch": { 
        "searchText": "", 
        // postalCode is only needed for territory locators
        "postalCode": "" 
            }, 
// Example of Lead form Content
    "content": { 
        "name": "John Smith", 
        "email": "john.smith@aol.com", 
        "phone": "(555) 867-5309", 
        "postalCode": "90210" 
        }, 
// Example of Lead form Content
    "typeKey": "getintouch-example", 
    "typeLabel": "Get in Touch"
} 
PropertyTypeDescription
organizationIDstringThe PowerChord ID for an organization. This associates a Lead to an organization.
locatorIDstringRequired if no organization is specified. This is what specifies which locator (locatorSettings) configuration will be used to assign dealer by location.
locationSearchobject (location search)Used to auto-assign a Lead to a location and organization (if organizationID> is empty)
contentobjectA Key/Value object of the lead form submission content
typeKeystringRequired. Machine-readable key used to categorize the lead.
typeLabelstringRequired. Human-readable label used to categorize the lead.
statusstringOptionally set the status of the lead. Defaults to open.

locationSearch Object

PropertyTypeDescription
searchTextstringIf supplied (and lat/long are empty), searchText will be used to geocode an address and create the lat/long. Even if address info is supplied here, the atomic address fields should also be sent in the contact data
postalCodestringOnly for region and territory logic based locator searches! Used to find a location assigned to the postalCode

Response Codes

CodeDescription
201 - CreatedLead Successfully created
400 - Bad RequestCheck error message for details to correct
403 - Not AuthorizedInvalid Auth Token or Auth Token missing from request

201 - Created

{
	"leadID": "< ID of the lead record created >",
	"assignedOrganizationID": "< ID of the organization the lead is assigned to >",
	"assignedLocationName": "< Name of the location the lead is assigned to >"
}

400 - Bad Request

If you get a 400 - Bad Request then check the message for details to correct.

Message: locatorID is required when no organization is specified

{ "message": "locatorID is required when no organization is specified" }

Message: No locations found to assign to the lead

{ "message": "No locations found to assign to the lead" }


Copyright © 2024