The Law Ruler API Guide Follow
The Law Ruler API is made available for usage by Law Ruler clients and their vendor partners. Sample Posting URLs are provided in this guide so you can bootstrap your API posts to Law Ruler in minutes. Enjoy!
Welcome and Introduction to the Law Ruler API
What is an API? An API is a way to share information between different software applications. The Law Ruler API allows third-party developers and vendor partners to “POST” new leads/intakes and case data into your Law Ruler TM system. Enjoy! We are glad you are here! 🙂
Also, you may also securely access data from Law Ruler by using the “GET” method.
⚠️ Please make sure that all API requests are URL-encoded form data.
☑️ Third-Party Vendor Compatibility
Using the POST Method, our API is instantly compatible with WordPressTM and other website forms including, but not limited to Contact Form 7TM, InstaPage TM, NinjaformsTM, Gravity FormsTM. It also is fully compatible to receive data from more than 1,000 lead vendors, contact forms, CRMs, and thousands of other 3rd party systems right out-of-the-box.
▶️ CallRail Video: Setting Up CallRail to Integrate w/ Law Ruler for Keyword Tracking from Google Analytics/Adwords
▶️ InstaPage Video: Setting Up InstaPage Landing Pages to Integrate with Law Ruler
✳️ Zapier: How to Use Zapier to Post Leads/Intakes to Law Ruler Using a Zap
🔒 Your Law Ruler API Security Key
Security Key: Law Ruler will generate a unique AES 256-bit security (bank-grade) key for each client portal. You may reuse this key for any API integrations with the same client portal. If you are a vendor, then ask your Law Ruler client to please provide you with their API key to get started.
✉️ For Law Ruler clients, please watch this API walkthrough ▶️ video about how to send your API key to each of your vendors.
Table of Contents
Welcome and Introduction to the Law Ruler API
Law Ruler API 101 – The Basics
What Fields are Required to POST via API?
Transmitting Files and Documents to Law Ruler via API
Duplicate Checking via the Law Ruler API
How to Post Intakes/Cases Where the Same Primary Contact is Used for Multiple Records
Creating a Lead/Intake via the Law Ruler API
Creating a Lead/Intake for the Same person for Multiple Cases (case types)
Update Data of an Existing Lead/Intake in Law Ruler via API
How to Use Zapier to Post Leads/Intakes to Law Ruler using a Zap
Lookup/Query Data from Law Ruler via API
Appendix 2.1 - Available Law Ruler API Fields
Law Ruler API 101 – The Basics
Let’s cover a few basics as we get started with some sample API posts.
The API and this document are evolving as needs arise. If you require any custom fields or other custom actions not included in this API Guide, then feel free to contact us and we can discuss a scope of work to add this functionality to suit your requirements.
Law Ruler recommends using the “POST” method to instantly send form-encoded data into Law Ruler via URL or directly from your form.
🔎 Law Ruler also uses the “GET” method to accept URL-encoded-data, query data, trigger programmable actions, and retrieve Client/Lead/Contact/Other data as needed. This can be used to Insert records, Update, and Query data out of Law Ruler as well as trigger actions. This API Guide includes the currently supported data fields, data field formats, descriptions, and examples, so you will know how to post to Law Ruler with ease and get started now.
📁 You may also transmit files to the Law Ruler API by using the multipart/form-data method.
Want to send data from your WordPress or other forms into Law Ruler?
📩 The POST method is the most common way to send data to the Law Ruler API with form-encoded data.
The GET method is similar to a webhook, the "Post form data to a URL" confirmation option lets you send your form submissions via the GET method to a pre-defined external URL. Unlike a webhook (which sends data via XML and JSON), the "Post form data to a URL" function sends a GET request with a message body that contains the form information as a data set that contains the key-value pairs (i.e. first_name=Test&email=test@unbounce.com).
The most common use for the feature is to send directly to a system that is set-up to accept application/x-www-form-URL-encoded form-data or multipart header form data via either the GET or POST method. Both methods are supported.
A simple form using the default application/x-www-form-urlencoded
content-type:
POST /test HTTP/1.1
Host: foo.example
Content-Type: application/x-www-form-urlencoded
Content-Length: 27
field1=value1&field2=value2
A form using the multipart/form-data
content-type:
POST /test HTTP/1.1
Host: foo.example
Content-Type: multipart/form-data;boundary="boundary"
--boundary
Content-Disposition: form-data; name="field1"
value1
--boundary
Content-Disposition: form-data; name="field2"; filename="example.txt"
value2
--boundary--
Note: The order of the data fields that you transmit to Law Ruler does *not* matter, and it does *not* need to be exactly as illustrated in the examples provided in the API Guide. Most fields are optional. Each field is separated by the “&” symbol when inserting fields in a URL string.
What Fields are Required to POST via API?
🔗 A complete list of API parameters is available below in Appendix 2.1, Available Fields
You will need the following required parameters to post a lead via API:
“FirstName” + “LastName” or “FullName”
“LeadProvider” - This should always be the source (the marketing source) of the lead/intake/caller. If you do not provide the Lead Provider, then Law Ruler will insert it as "Unknown API Post" to prevent your API posts from failing.
“Key” - This is the client’s secret posting key that will be provided to you. Contact Law Ruler Support if you have not been given this yet and need it.
⚠️ Note: If the parameter “Status” is not included in the API posting string then it will default to “Status=New Lead”
Transmitting Files and Documents to Law Ruler via API:
Files/documents are accepted with multipart header form data using the Raw request body. Multipart header forms should be used for uploading files to the API. The multipart/form-data method is needed to post files via API to our endpoint via HTTP POST.
For encoding of the request body, the Law Ruler API does not support base 64 or binary file encoding.
Supported File Formats: .txt, .doc, .docx, .pdf, .xls, .xlsx, .jpg, .jpeg, .png, .gif, .mp3
For more information on how to encode multipart form posts, visit W3 Schools.
You may also want to review this video that demonstrates how to send multipart/form-data requests with Postman.
Duplicate Checking via the Law Ruler API:
How does duplicate checking work inside of Law Ruler?
If you attempt to post duplicate data into Law Ruler, then the post will fail. Our duplicate checking per Case Type and is run against the lead/intake’s full name, email, cell & home phone fields.
By default, you can post two records that have the same contact info if and only if they are different case types, or the second post will be rejected as a duplicate. This is helpful since one person may have multiple matters with your firm. Example: If a potential client has the same contact information but is opening up two different cases such as auto accident & workers compensation.
If you would like to update the lead, then the parameter “LeadID” is required for data integrity reasons. By requiring the “LeadID” to make an update, your firm will not have data overwritten by vendors by accident. It is recommended that when you post new leads to Law Ruler, that you store the "LeadID" which is contained in the API Response message from Law Ruler. Then, your system will have the "LeadID" to update any leads that you created.
Example of a Successful API Post Response Message:
API Post Response:
Success Lead #12345
Lead ID:
12345
☑️ Note: API error messages are enabled. If a post fails then the reason will be in the error response. You may use the error responses to perfect your posts.
New! - JSON Responses
We have added the ability to return API responses in JSON:
To get a JSON response you will need to add the following parameter inside your POST.
How to Post Intakes/Cases Where the Same Primary Contact is Used for Multiple Records
⏹️ 👨👩👧👧 Need to Turn Off Duplicate Checking for "On Behalf Of" (OBO) (Death/Decedent/Minor/Child) Cases where multiple records share the same Primary Contact?
Sometimes there will be exceptions where you have multiple leads/intakes/cases to post to Law Ruler that all share the same Primary Contact.
One scenario would be the parent, legal representative, or guardian acting "On Behalf Of" (OBO) of multiple plaintiffs. For this scenario, there is a way to Turn Off duplicate checking in new posts so each plaintiff with the same Primary Contact may be posted as their own record, without merging together into one record.
If you do not disable duplicate checking for this scenario, then the records will all merge into one record when posting because the use of the same Primary Contact will make them appear to be duplicated to the Law Ruler API.
Example Diagram of the Same Primary Contact Used for Multiple Plaintiffs
Example: Annabel is the same guardian (Primary Contact) for three different cases (three minor children). The plaintiff information for the three minor children (Catherine, Harry, and Michael) would be posted to Custom API fields. They would all share the same Primary Contact (Annabel).
We would suggest selectively turning off Duplicate Checking for this scenario for API Posts that are related to ONLY these leads/intakes/cases. This would permit Law Ruler to create three separate records for each of the minor children plaintiffs, with the same Primary Contact (Annabel) to be used on all three records.
The parameter to disable duplicate checking needs to be included as a posting field and will be passed as follows to disable duplicate checking:
dupcheck=0
⚠️ We strongly recommend that you implement logic to only use this parameter for these exceptions and not to leave it on for every API Post. Please do not disable duplicate checking unless you have this unique scenario in play, and if you do it, then do it selectively.
Creating a Lead/Intake via the Law Ruler API
Want to create a New Lead in Law Ruler or Update the data to an Existing Lead? Law Ruler uses the term “Lead” and is meant to refer to either a Lead or Intake.
Create Lead Sample of a POST link with all of the fields, use the ones you would like to try:
https://sample.lawruler.com/Lawruler-Parsing.aspx?FirstName=John&LastName=Smith &Address1=123 AnystreetCity=WilkesBarre&State=PA&Zip=12345&CellPhone=570-123-7899&HomePhone=570-123-7899&Email1=test@testing.com&Summary=His vehicle was hit by a drunk driver&CaseType=Auto Accident&LeadProvider=Google&Hear=Live Chat&Key=Y8d7cMkSLGhONnZyjzVAVbhGV9eXX8
Update Data or Status of an Existing Lead/Intake in Law Ruler via API
🔗 A complete list of API parameters is available below in Appendix 2.1, Available Fields
In this example, we are only updating the Status field, and we are changing the Status of this Lead/Contact/Intake to “Signed Retainer Contract”
Sample of a POST link to change Status: https://sample.lawruler.com/Lawruler-Parsing.aspx?LeadId=1203&Status=Signed Retainer Contract&Key=Y8d7cMkSLGhONnZyjzVAVbhGV9eXX8
⚠️ The name, phone, email address of Primary Contacts may not be updated after a leads/intake/case has been created. This is a protection in place to prevent the law firm staff from having this critical information changed without their consent. All other fields may be updated.
If you need to update the name, phone, email address of Primary Contacts, then we recommend that you post a note to the firm with the new information, or send that data to "Summary" in the Case Description.
How to Use Zapier to Post Leads/Intakes to Law Ruler using a Zap
To get started, you will click the orange "Make a Zap!" button in the top-right corner of Zapier.
Then, you will “Choose App & Event” by selecting your external website/landing page app that you will be connecting to Zapier. If you do not see your app, then press “Show All” to see more options in the Zapier App menu or use the Search here field and type in the name.
🆘 Law Ruler Support cannot provide customer support for Zapier since they are a third-party company. For technical or customer support with Zapier, please contact Zapier Support. If you would like Law Ruler to assign an expert integration consultant to consult with you or perform these integrations for you, then that service is available on-demand for a consulting fee.
For our example, we will use InstaPage as our "App" for this Zap, for demonstration purposes only:
Then, you will see the “When this happens…” screen in Zapier. Do not change any of these settings.
Press the blue “Continue” button as shown.
After you continue, it should look this way. You may need to add/authenticate your external App/Website credentials to connect it to Zapier, so please follow any of those instructions, if prompted to do so.
Now, click on the “Do this… POST” step as shown below.
For the “Choose App” option, you will be using the “Webhooks by Zapier” feature to integrate.
Next, click on “Customize Post” to open up the API parameters. This is where you will add your Law Ruler Secret API Key and other required parameters to create leads/intakes in Law Ruler.
Make sure that the "Payload Type" is selected as "Form" since it must be encoded as form data.
When finished adding the Law Ruler API parameters, you will press the blue “Done Editing” button at the bottom of the screen. We do not suggest that you change any other settings inside of the Zap unless you know what you are doing.
Finally, there are a couple of important steps left to get this Zap going. You will need to “Activate” the Zap inside of Zapier after thoroughly test the Zap before going live with it in a production environment.
Please be aware that Law Ruler duplicate checking rules will not allow you to recreate test Posts with the same phone number/email address and will reject them as duplicates. Thus, when you are testing, use unique test phone numbers/email address data for each test for optimal results! 😊
Posting Data to Custom Fields
All you will need to do is get a list of custom fields from the firm and add them to your posting string. ANY field in Law Ruler intake/case forms can be posted to. This is highly recommended since by posting data to each individual field, you will save time with data entry and increase accuracy with each intake.
All standard and custom field parameters can be found inside the Law Ruler Intake/Case Form Builder (https://YOURSITENAME.lawruler.com/QuestionnaireFormBuilder.aspx) under each question label.
⚠️ You will remove the << >> angular brackets from the field name to get the API parameter name for each custom field and you must use lower case. Custom fields are case sensitive and require lower case.
Example: custom2413
⚠️ For case type-specific custom fields, you must make sure that you are posting into the same case type that the fields belong to, or the fields will not work. For example, if you have custom2413 in the Auto Accident case type, but not accessible to All case types, then you may only use that custom field with API posts that are for the Auto Accident case type.
Sample posting string with custom field parameters:
https://sample.lawruler.com/Lawruler-Parsing.aspx?FirstName=John&LastName=Smith &Address1=123 AnystreetCity=WilkesBarre&State=PA&Zip=12345&CellPhone=570-123-7899&HomePhone=570-123-7899&Email1=test@testing.com&Summary=His vehicle was hit by a drunk driver&custom1=datagoeshere&custom2=datagoeshere&custom3=datagoeshere&custom4=data&CaseType=Auto Accident&LeadProvider=UTMSOURCEGOESHERE&Hear= Yourcompanyname &Key=Y8d7cMkSLGhONnZyjzVAVbhGV9eXX8
For posting data to Picklist fields, if you need to fill data for multiple options, you will need to separate each picklist option with a comma ","
Example: custom1953
Value: Option3,Option2
(You would put in the actual data and not insert it as "Option 3, Option 2" since that was for example purposes)
If your field was "What colors are there in a rainbow?" and the data that you wanted to insert some data, then you would insert it as "Orange, Yellow, Blue, Green, Red"
Lookup / Query Data from Law Ruler via API Using the GET Method
Let’s say that you want to find out the status of a lead, or look up something about a particular lead/intake with an API Post. This can be done programmatically from the API using the operation “GetStatus” or by using the parameter “ReturnXML=True”. This section will cover how to get data from Law Ruler about a particular Lead/Contact/Intake from your application.
In order to do the lookup/query, you will need either the "LeadID" (&LeadId).
If the Lead/Contact was created using a DNI (keyword tracking) integration you can also do the lookup using the Google Click ID # / the GCLID
Note: This outputs a feed of machine-readable XML Just use the appropriate start/end markers such as <Lead> and </Lead> for XML.
Sample of a POST link to query data from Law Ruler via your application:
https://sample.lawruler.com/Lawruler-Parsing.aspx?Key=Y8d7cMkSLGhONnZyjzVAVbhGV9eXX8&LeadAssignee=Carolyn+Test&LeadID=6220&
Operation=GetStatus&ReturnXML=True&LeadId=[LeadID]&GCLID=[GCLID]
The API response message will be in machine-readable XML that your application can parse in for any queried fields:
Firstname, Lastname, address1, address2, city, state, zip, cellphone, homephone, businessphone, email, summary, conversation, CaseType, LeadProvider, Status, LeadOwner, LeadAssignee
Sample of an Actual XML Reply
You will need to install an XML Viewer in your Internet Browser to see the XML or the Control-U key will not do anything. We recommend the XML Tree Google Chrome Browser Extension.
Appendix 2.1 - Available Law Ruler API Fields
(Each API field must be separated by the “&” symbol. Do not include colon characters ":" they are for visual purposes only in the guide below)
LeadID: This is the unique identifier for each Lead in Law Ruler (Type: Integer)
CaseType: Type: of Case as provided, ex: Motor Vehicle Accident, Divorce, Custody, Xarelto, Qui Tam, etc (Type: Varchar Max Length 255)
LeadProvider: This is the Lead’s Marketing Source or UTM Source, where the Lead/Contact/Intake came from. For example Firmname.com, Main website page, Google, TV advertisement (Type: Varchar Max Length 255).
If you forget to include this, then Law Ruler inserts “Unknown API Post” as the Lead Provider, to prevent your API Posts from failing. *** This is a Default Field that is Required ***
Hear: This field is for the Contact Method of the lead/marketing source for each lead/intake. (Ex: nGage, Apex, Alert Communications, Intake Desk)
Status: The status of the Lead/Contact. You must map to existing statuses in Law Ruler. If you want to create new statuses first, then please create them so you may map them. Ex: New Lead/Contact, Emailed Intake Questionnaire, Sent Retainer Contract, Signed Retainer Contract, Converted to CaseApproved (Type: Varchar Max Length 255)
Tags: Add tags to any Lead/Case. For multiple, separate with commas: Tags = New, Level 1, High Value
FirstName: First Name of the Lead/Contact (Type: Varchar Max Length 255)
LastName: Last Name of the Lead/Contact (Type: Varchar Max Length 255)
FullName: This is Optional in case First Name and Last Name is not provided
(Type: Varchar Max Length 255)
Address1: Street Address Line 1 (Type: Varchar Max Length 255)
Address2: Street Address Line 2 (Type: Varchar Max Length 255)
City: City name (Type: Varchar Max Length 255)
County: County name (Type: Varchar Max Length 100)
State: Shortcode abbreviation of a State, or full name of the State (Type: Varchar Max Length 255)
Zip: Zipcode varied length and international zip codes are okay (Type: Varchar Max Length 15)
Note: Cell Phone is a required field in Law Ruler and if only one phone number is provided, then please default to the Cell Phone field since you will not be able to send SMS Texts otherwise
CellPhone: Cell Phone (If a single number is available for the lead, then please insert it in Cell phone) (Type: Varchar Max Length 30) *** This is a Default Field that is Required ***
HomePhone: Home Phone No with or without country code International Numbers are okay this field is multi-length. (If a single number is available for the lead, then please insert it in Cell phone)
(Type: Varchar Max Length 30)
BusinessName: Company Name associated with a contact. (If this is the only name parameter passed, the contact created will be of type Business instead of Individual)
BusinessPhone: Business Phone (If a single number is available for the lead, then please insert it in Cell phone) (Type: Varchar Max Length 30)
Email1: Primary Email Address (Type: Varchar Max Length 255)
*** This is a Default Field that is Required ***
Email2: Secondary Email Address (Type: Varchar Max Length 255)
SSN: Social Security Number (Type: XXX-XX-XXXX must include the dashes, Ex: 123-45-6789)
DOB: Date of Birth (Type: Date Format MM/DD/YYYY or MM-DD-YYYY and must include the slashes or dashes or it will not be accepted) Ex: 01/11/2001 or 01-01-2001
DriversLicense: The driver’s license number of the primary contact on a lead/intake/case (Type: Varchar Max Length 255)
ContactPreference: What is the best way to reach this lead/intake/client? During the day, after 5 pm on weekdays, etc (Type: Varchar Max Length 255)
WhenToContact: When is the best time for this lead/intake/client to be contacted?
(Type: Varchar Max Length 255)
LeadAssignee: This is the current user assigned to managing the lead/contact/matter
LeadOwner: This is the current user that owns the lead/contact/matter
Date: Date of Lead/Intake Creation (Type: Date Format MM/DD/YYYY) Ex: 01/11/2011. This is not necessary but is an available field. The system will insert new leads in your firm's primary time zone.
Time: (Time Format hh:mm:ss) All times inserted in Central Time Zone UTC-6 in 24 hours format.
Summary: Case Description/Synopsis of the Case (No Max Length since it is a text field)
CaseRole: The case role of the lead. Ex. "Lead" , "Client" (Type: Varchar Max Length 50)
ContactType: The contact type of the contact. Ex. "Lead" , "Client", "Caller" (Type: Varchar Max Length 50)
UTM_Medium: The medium of where the lead/contact is from, if Available (Type: Varchar Max Length 255) (Law Ruler DNI Required)
UTM_Term: Search Engine Source Keywords, if available (Type: Varchar Max Length 255) (Law Ruler DNI Required)
UTM_Landing: The landing page where the Lead/Intake was created from this URL
(Type: Varchar Max Length 255) (Law Ruler DNI Required)
UTM_Campaign: The landing page where the Lead/Intake was created from this URL
(Type: Varchar Max Length 255) (Law Ruler DNI Required)
GID: The anonymous Google Client ID (CID) for the website visitor as related to a Lead/Contact (Type: Varchar Max Length 255) (Law Ruler DNI Required)
CampaignName: This is the Ad Campaign Name. This is primarily used with the Five9 integration but could be used for custom implementations for other use cases.
Conversation: Example Chat or Other Transcripts (No Max Length it is a text field)
Key: This is the unique security token key that uses bank-grade AES 256-bit encryption for the client portal and is generated by Law Ruler. This will prevent spam and garbage posts in the client portal.
dupcheck: This is to turn off duplicate checking and should only be used for exceptions where the same Primary Contact is used for multiple leads/intakes/cases. This must be set to = "0" / False to be used. Example use: dupcheck=0
Language: The language of the lead/intake. The API Field “Language” requires the Language # to be passed in API Posts. In Law Ruler, the Default Language=17 which is English.
Planned usage of Language field: Lawruler-Parsing.aspx?leadid=11618&language=58&key=4YGH7PYA8BACHA3ZAAzhLiNJLG1IZj
List of all Available Language Values in Law Ruler:
LanguageID |
Language |
LanguageID |
Language |
LanguageID |
Language |
LanguageID |
Language |
1 |
Afrikaans |
21 |
Finnish |
41 |
Laothian |
61 |
Tamil |
2 |
Albanian |
22 |
French |
42 |
Lithuanian |
62 |
Telugu |
3 |
Arabic |
23 |
Galician |
43 |
Macedonian |
63 |
Thai |
4 |
Azerbaijani |
24 |
Georgian |
44 |
Malay |
64 |
Turkish |
5 |
Basque |
25 |
German |
45 |
Maltese |
65 |
Ukrainian |
6 |
Bengali |
26 |
Greek |
46 |
Malayalam |
66 |
Urdu |
7 |
Belarusian |
27 |
Gujarati |
47 |
Marathi |
67 |
Vietnamese |
8 |
Bulgarian |
28 |
Haitian Creole |
48 |
Mongolian |
68 |
Welsh |
9 |
Catalan |
29 |
Hebrew |
49 |
Norwegian |
69 |
Yiddish |
10 |
Chinese (Hong Kong) |
30 |
Hindi |
50 |
Persian |
70 |
Zulu |
11 |
Chinese (Simplified) |
31 |
Hungarain |
51 |
Polish |
|
|
12 |
Chinese (Traditional) |
32 |
Icelandic |
52 |
Portuguese |
|
|
13 |
Croatian |
33 |
Indonesian |
53 |
Romanian |
|
|
14 |
Czech |
34 |
Irish |
54 |
Russian |
|
|
15 |
Danish |
35 |
Italian |
55 |
Serbian |
|
|
16 |
Dutch |
36 |
Japanese |
56 |
Slovak |
|
|
17 |
English |
37 |
Kannada |
57 |
Slovenian |
|
|
18 |
Esperanto |
38 |
Korean |
58 |
Spanish |
|
|
19 |
Estonian |
39 |
Latin |
59 |
Swahili |
|
|
20 |
Filipino |
40 |
Latvian |
60 |
Swedish |
|
|
In order for a lead to be updated in the system, there must be a posting parameter of "overridelead=true"
Thanks very much!
You may also view our Getting Started Videos and Support Forum about Law Ruler, or Submit a Support Ticket anytime.