Integration with CRM/Salesforce

Written by Brad Pirtle
Updated 8 months ago

Know True-Up can integrate with and CRM like Salesforce using the KTU API. 
An example is creating a user in Know True-Up when a Salesforce Opportunity changes stage to Closed Won.


To help make this simple, use a Workflow Automation tool that integrates to your CRM like Zapier to trigger an API call into Know True-Up.  You can use any integration tool to accomplish this.

Below is an example using Zapier.  You will need to modify this (what triggers it, what fields you want) based on your specific needs and how you use your CRM.

Documentation on the users API endpoint: documentation

  1. Create a new Zap, in this case named "Know True-Up User Zap".
  2. Add a Trigger:
    App = Salesforce
    Event = Updated Field on Record
    Salesforce Object = Opportunity
    Field = Stage
    Field Updated to = Closed Won
  3. If you need to filter any additional fields, add "Only continue if" Filter, for example if "Contract Type" = "Pros Package"
  4. Add a Custom Request Webhook:
    Method = POST
    URL = https://api.solardatapros.com/api/v1/users
    Data Pass Through = False
    Data = JSON API call.  Substitute Salesforce fields for the appropriate fields, ie lastName=LastName.   
    Example:
    {"user": {"firstName": "SF_FIRSTNAME", "lastName": "SF_LASTNAME", "email": "SF_EMAIL", "enableAccess": "1", "enableEmails": "1"}, "account": {"xid": "SF_ACCOUNTID", "phone": "SF_PHONE", "addressOne": "SF_STREET", "city": "SF_CITY", "state": "SF_STATE", "zip": "SF_ZIP", "isLead": "0"}, "plan": {"name": "SF_CONTRACT_TYPE", "nameMatch": "Pros"}, "sendEmailTemplate": "KTU_EMAIL_TEMPLATE_NAME", "test": "0"}
    Test with "test=1" so the user will not get created but you will get the email to see if it works,
    Unflatten = Yes
    Headers = Api-Key=KTU_API_KEY, Access-Token=KTU_ACCESS_TOKEN, Content-Type=application/json
    Get your Api-Key and Access-Token values from your KTU rep.
  5. Add a Path with 2 paths (one for success and one for failure):

    Path1

    Name = "Path Failure"
    Filter = Only continue if = success contains false
    Send Outbound Email, example:
    Subject: Zapier Failure
    To: YOUR_EMAILS
    Body:
    Zapier failure calling the Know True-Up API.<br> <br>
    <table border="1" cellpadding="5" style="border-collapse:collapse; padding:10px;"><tr><td>Salesforce Opportunity:</td><td><b>SF_NAME
    </b></td></tr> <tr><td>API response:</td><td><b>KTU_RESPONSE_MESSAGE</b></td></tr> </table><br> <table border="1" cellpadding="5" style="border-collapse:collapse; padding:10px;"> <tr><td>First Name:</td><td><b>SF_FIRST_NAME</b></td></tr> <tr><td>Last Name:</td><td><b>SF_LAST_NAME</b></td></tr> <tr><td>Email:</td><td><b>SF_EMAIL</b></td></tr> <tr><td>Phone:</td><td><b>SF_PHONE</b></td></tr> <tr><td>Address:</td><td><b>SF_STREET<br>SF_CITY, SF_STATESF_ZIP</b></td></tr> <tr><td>Plan Name:</td><td><b>SF_CONTRACT_TYPE</b></td></tr> </table><br> <br> COMPANY_NAME<br>

    Force Linebreaks = false

    Path2
    Name = "Path Success"
    Filter = Only continue if = success contains true
    Send Outbound Email, example:
    Subject: Zapier Success
    To: YOUR_EMAILS
    Body:
    Zapier success calling the Know True-Up API.<br> <br>
    <table border="1" cellpadding="5" style="border-collapse:collapse; padding:10px;"><tr><td>Salesforce Opportunity:</td><td><b>SF_NAME
    </b></td></tr> <tr><td>API response:</td><td><b>KTU_RESPONSE_MESSAGE</b></td></tr> </table><br> <table border="1" cellpadding="5" style="border-collapse:collapse; padding:10px;"> <tr><td>First Name:</td><td><b>SF_FIRST_NAME</b></td></tr> <tr><td>Last Name:</td><td><b>SF_LAST_NAME</b></td></tr> <tr><td>Email:</td><td><b>SF_EMAIL</b></td></tr> <tr><td>Phone:</td><td><b>SF_PHONE</b></td></tr> <tr><td>Address:</td><td><b>SF_STREET<br>SF_CITY, SF_STATESF_ZIP</b></td></tr> <tr><td>Plan Name:</td><td><b>SF_CONTRACT_TYPE</b></td></tr> </table><br> <br> COMPANY_NAME<br>

    Force Linebreaks = false
  6. Test your Zap
Did this answer your question?