Accident.com Auto Accident API Documentation
Table of Content
fields
Arrayref
Guidecase_type
- Auto AccidentThe api-key and api-secret header should be set in order to make requests to our API. Provided below is api-key and api-secret for your account. If you have any troubles, please email [email protected]
#!curl
$ curl --location --request POST 'https://example.leadprosper.tech/accident.com/api/lead-create' \
--header 'api-key: dmoeEhTK-JRJE-XdqJ-v3vD-XNFYFei4umeY' \
--header 'api-secret: e66dcbda51f9f39c10d555bd38d020314d938e29'
The request body for type - lead should comply with these rules.
Name |
Required |
Type |
Description |
arrived_at |
True |
Timestamp |
Should be in UTC. |
test_mode |
False |
Boolean |
Default : false. Should be set as true if the API call is used to send test data. |
deal |
True |
Text |
EGRQoxOrWdlV4MW1xwg1jX7vAbYnKZ is the deal ID value and should be passed in every request against this deal. |
lead_first_name |
False |
Text |
First name of the lead. |
lead_last_name |
False |
Text |
Last name of the lead. |
lead_email |
True |
|
Email Address of the Lead. |
lead_phone |
True |
Phone |
Phone number of the lead. This can be either in US Domestic format ( Eg: (541) 754-3010 ) or in E.164 format ( Eg: +14155552671 ) |
Name |
Required |
Type |
Description |
case_type |
True |
Text |
Auto Accident is the accepted case type for this deal |
zip_code |
True |
US Zip Code |
Zip code of the Lead. |
time_to_call |
False |
Text |
If the lead has a time preference for callback, pass that in this parameter. |
fields |
True |
Array |
The request body for Auto Accident is mentioned below. |
post_back_url |
False |
URL |
URL/Endpoint on vendor’s system to hit if the lead received matches the payable criteria according to the insertion order or a payable event discussed mutually. The URL should ideally be specified with the HTTP Method in post_back_method parameter. If no post_back_method is provided, system will default it to a GET request. |
post_back_method |
False |
HTTP Method |
If there’s a post back URL that should be triggered on receiving a lead that matches the payable criteria according to the insertion order or a payable event discussed mutually, specify the the URL in post_back_url. If no post_back_method is provided, the system will default it as a GET request. |
lead_instance_id |
False |
Text |
The vendor can share their lead ID with us using this parameter |
subid1 |
False |
Text |
Custom parameter |
subid2 |
False |
Text |
Custom parameter |
subid3 |
False |
Text |
Custom parameter |
subid4 |
False |
Text |
Custom parameter |
subid5 |
False |
Text |
Custom parameter |
The fields array in the request contains objects. Each of these objects has three properties
Property |
Required |
Description |
ref |
True |
The question reference is used by our internal system to identify the questions that are being passed. |
title |
False |
Use this field to pass us the scripting question that was used. If any changes are made to the way the question is asked, those changes should reflect the title field. |
answer |
True |
The answer comes from a set of choices or adheres to a type. The “ref guide” section explains the ref and their rules. |
Example :
#!json
{ "ref":"have_attorney", "title": "Do you have an attorney representing you for this matter?", "answer" : "No" }
Below are all of the ref values that can be used in the fields array. Each ref has a type and can be a choice of options, a boolean or text. We have included the default question that will get considered should the ref object have a missing title property. The explanation of which ref objects to be used for each case_type is mentioned later in the document. The answers in the field object should come strictly from the set of values provided below.
Ref Key |
Type |
Choices |
Description |
Default Question |
incident_date_option_b |
Enum / Text |
Less than 1 year , Less than 2 years , Less than 3 years, MM-DD-YY , MM-DD-YYYY, MM-YYYY , YYYY |
Single Choice. Should be used for date questions. The actual date can be specified in the mentioned format. |
When did the accident happen? |
have_attorney |
Yes/No |
Yes , No |
Single Choice. Whether lead already has an attorney. In case of unsure, the answer to choose should be No. |
Do you already have an attorney representing you? |
doctor_treatment |
Yes/No |
Yes,No |
If the lead received medical treatment for their injures. If No , disqualify. |
Were you hospitalized or did you receive medical treatment for your injury? |
expressed_interest |
Yes/No |
Yes,No |
If the lead expressed interest in speaking with an attorney about their case. If No, disqualify. |
Do you want to speak with an attorney regarding your case? |
were_you_at_fault |
Yes/No |
Yes , No |
Single Choice. Lead at fault. In case of unsure, the answer should be No . |
Were you placed at fault for the accident? |
were_you_injured |
Yes/No |
Yes , No |
Single Choice. If the lead has a bodily injury, the answer should be Yes. In case of unsure, the answer should be No . |
Were you injured? |
Ref Key |
Type |
Choices |
Description |
Default Question |
injury_cause |
Text |
Car Accident , Motorcycle Accident , Truck Accident , Bicycle Accident , Pedestrian Accident , Passenger Accident |
Text value for what caused the injury. |
What is the cause of your injury? |
terms |
Yes/No |
I agree, I do not Agree |
Single Choice. The lead agrees to Accident.com ’s terms of service. |
Please read and accept our Terms of Service |
primary_injury |
Enum |
Back or Neck Pain , Broken Bones , Cuts and Bruises , Headaches , Memory Loss , Loss of Limb , Other |
Single Choice. Please use the closest possible injury type, If the answer from the caller doesn’t match the list or there is something additional to add for a particular choice, comments ref can be used to furnish those details. |
What is the primary type of injury? |
comments |
Text |
NA |
Text. Please include additional details about the case here. |
Briefly describe your case |
settled_insurance |
Yes/No |
Yes, No |
Single Choice. If the lead has already settled with the insurance company. In case of unsure, the answer should be No. |
Have you settled with the insurance company regarding your injuries? |
signed_retainer |
Yes/No |
Yes, No |
Single Choice. If the lead has already signed a retainer with a lawfirm. In case of unsure, the answer should be No. |
Have you ever signed a retainer with another law firm regarding this case? |
role_in_accident |
Enum |
passenger, driver, pedestrian |
Single Choice. Used in MVA cases, to relate the lead’s role in the accident. |
Were you the driver, passenger or pedestrian? |
driver_insured |
Yes/No |
Yes, No |
Single Choice. Used in MVA cases indicating if the other driver involved in the accident has a valid auto insurance. |
Did the other driver, who was at fault, have auto insurance? |
Ref Key |
Type |
Choices |
Description |
Default Question |
accident_vehicle_count |
Text |
NA |
Used in MVA cases indicating the number of vehicles that were involved in the accident. |
How many cars were involved in the accident? |
Mentioned below are the properties that will be present in the response object.
Key |
Description |
status |
created - to acknowledge we received the details. failed - We received the details but the request was poorly formulated. error - Something has gone wrong. |
result |
success - we assert that we received this request |
message |
acknowledgement message for the request |
Response Skeleton
#!xml
<?xml version="1.0"?>
<response>
<message>Lead generated successfully</message>
<status>created</status>
<result>success</result>
</response>
Following set of references should be passed for Auto Accident case type.
incident_date_option_b
(Required)were_you_at_fault
(Required)were_you_injured
(Required)have_attorney
(Required)doctor_treatment
expressed_interest
injury_cause
primary_injury
settled_insurance
settled_insurance
signed_retainer
driver_insurance
role_in_accident
accident_vehicle_count
comments
Please refrain from any hard-coding and mapping unless discussed with Accident.com team.
#!curl
curl --location --request POST 'https://example.leadprosper.tech/accident.com/api/lead-create' \
--header 'api-key: dmoeEhTK-JRJE-XdqJ-v3vD-XNFYFei4umeY' \
--header 'api-secret: e66dcbda51f9f39c10d555bd38d020314d938e29' \
--header 'Content-Type: application/json' \
--data-raw '{ "arrived_at":"2020-1-01T10:26:21Z", "test_mode":"false", "deal":"EGRQoxOrWdlV4MW1xwg1jX7vAbYnKZ", "lead_first_name":"Test", "lead_last_name":"Lead", "lead_email":"[email protected]", "lead_phone":"9999999999", "case_type": "Auto Accident", "zip_code":"10027", "subid1":"1234", "subid2":"2345", "incident_date_option_b" : "Less Than 1 yeat" "fields":[ { "ref":"incident_date_option_b", "title": "When did the accident happen?", "answer" : "Less than 1 year" }, { "ref":"were_you_injured", "title": "Were you injured in an Auto Accident?", "answer" : "Yes" }, { "ref":"were_you_at_fault", "title": "Were you placed at fault for the accident?", "answer" : "No" }, { "ref":"injury_cause", "title": "What caused your injury?", "answer" : "Motorcycle Accident" }, { "ref": "expressed_interest", "title": "Do you want to speak to an Attorney?", "answer": "Yes" }, { "ref":"have_attorney", "title": "Do you have an attorney?", "answer" : "No" }, { "ref":"primary_injury", "title": "Did you sustain any of the following?", "answer" : "Headaches" }, { "ref":"doctor_treatment", "title": "Did the injury require hospitalization, medical treatment, surgery or cause you to miss work?", "answer" : "Yes" }, { "ref": "accident_vehicle_count", "title": "How many cars were involved in the accident?" "answer": "2" }, { "ref":"settled_insurance", "title": "Have you settled with the insurance company regarding your injuries?", "answer" : "No" }, { "ref":"signed_retainer", "title": "Have you ever signed a retainer with a law firm regarding this case?", "answer" : "No" }, { "ref": "driver_insurance", "title": "Did the other driver, who was at fault, have auto insurance?", "answer": "Yes" }, { "ref": "role_in_accident", "title": "Were you the driver, passenger or pedestrian?", "answer": "driver" }, { "ref":"comments", "title": "Describe your case", "answer" : "test description" } ] } '
Post Back URLs help us communicate back to our Vendor that a payable event has occured. If the lead received matches the payable criteria according to the insertion order or a payable event discussed mutually, post_back_url can be used as a way of communicating back to the vendor that a payable condition was just met.
It’s vital that post_back_urlis accompanied with a post_back_method to make a valid HTTP request. If post_back_method is not specified, system will default it as a GET request.
A few sub ID params are also populated in the request.
#!curl
curl --location --request POST'https://example.leadprosper.tech/accident.com/api/lead-create'
--header 'api-key: dmoeEhTK-JRJE-XdqJ-v3vD-XNFYFei4umeY' \
--header 'api-secret: e66dcbda51f9f39c10d555bd38d020314d938e29' \
--header 'Content-Type: application/json' \
--data-raw '{ "arrived_at": "2021-07-27T23:42:55Z", "test_mode": "false", "type": "lead", "deal":"EGRQoxOrWdlV4MW1xwg1jX7vAbYnKZ", "lead_first_name": "test", "lead_last_name": "test", "lead_email": "[email protected]", "lead_phone": "9175405450", "case_type": "Auto Accident","zip_code": "82001", "post_back_method": "POST", "post_back_url": "https://post-back.example.post-back-url.com", "lead_instance_id": "12456", "subid1": "689", "subid2": null, "subid3": "display", "subid4": null, "subid5": null, "fields": [ { "answer": "Yes", "ref": "were_you_injured", "title": "Were you Injured in an Auto Accident?" }, { "answer": "Motorcycle Accident", "ref": "injury_cause", "title": "What caused your injury?" }, { "answer": "no", "ref": "have_attorney", "title": "Do you currently have a lawyer representing your claim?" }, { "answer": "Broken Bones", "ref": "primary_injury", "title": "Did you sustain any of the following?" }, { "answer": "Yes", "ref": "doctor_treatment", "title": "Did the injury require hospitalization, medical treatment" }, { "answer": "01-07-2022", "ref": "incident_date_option_b", "title": "When did the accident happen?" }, { "answer": "Yes", "ref": "expressed_interest", "title": "Do you want to speak to an Attorney?" }, { "answer": "Test comments", "ref": "comments", "title": "describe your case" }, { "answer": "no", "ref": "signed_retainer", "title": "Have you ever signed a retainer with another law firm regarding this case?" }, { "answer": "driver", "ref": "role_in_accident", "title": "Were you the driver, passenger or pedestrian?" }, { "answer": "Yes", "ref": "driver_insured", "title": "Did the other driver, who was at fault, have auto insurance?" }, { "answer": "2" "ref": "accident_vehicle_count", "title": "How many cars were involved in the accident?" } ] }'