Calculate Risk Score
curl --request POST \
--url https://api.example.com/v1/risk-score/ppa-garaging \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"policy_holder_id": "policy-holder-123",
"vehicles": [
{
"vehicle_id": "vehicle-123",
"garaging_location": {
"latitude": 36.890333,
"longitude": -95.967285
},
"body_type": "passenger-car"
}
],
"version": "v2",
"effective_date": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.example.com/v1/risk-score/ppa-garaging"
payload = {
"policy_holder_id": "policy-holder-123",
"vehicles": [
{
"vehicle_id": "vehicle-123",
"garaging_location": {
"latitude": 36.890333,
"longitude": -95.967285
},
"body_type": "passenger-car"
}
],
"version": "v2",
"effective_date": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
policy_holder_id: 'policy-holder-123',
vehicles: [
{
vehicle_id: 'vehicle-123',
garaging_location: {latitude: 36.890333, longitude: -95.967285},
body_type: 'passenger-car'
}
],
version: 'v2',
effective_date: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.example.com/v1/risk-score/ppa-garaging', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/risk-score/ppa-garaging",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'policy_holder_id' => 'policy-holder-123',
'vehicles' => [
[
'vehicle_id' => 'vehicle-123',
'garaging_location' => [
'latitude' => 36.890333,
'longitude' => -95.967285
],
'body_type' => 'passenger-car'
]
],
'version' => 'v2',
'effective_date' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/risk-score/ppa-garaging"
payload := strings.NewReader("{\n \"policy_holder_id\": \"policy-holder-123\",\n \"vehicles\": [\n {\n \"vehicle_id\": \"vehicle-123\",\n \"garaging_location\": {\n \"latitude\": 36.890333,\n \"longitude\": -95.967285\n },\n \"body_type\": \"passenger-car\"\n }\n ],\n \"version\": \"v2\",\n \"effective_date\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/risk-score/ppa-garaging")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"policy_holder_id\": \"policy-holder-123\",\n \"vehicles\": [\n {\n \"vehicle_id\": \"vehicle-123\",\n \"garaging_location\": {\n \"latitude\": 36.890333,\n \"longitude\": -95.967285\n },\n \"body_type\": \"passenger-car\"\n }\n ],\n \"version\": \"v2\",\n \"effective_date\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/risk-score/ppa-garaging")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"policy_holder_id\": \"policy-holder-123\",\n \"vehicles\": [\n {\n \"vehicle_id\": \"vehicle-123\",\n \"garaging_location\": {\n \"latitude\": 36.890333,\n \"longitude\": -95.967285\n },\n \"body_type\": \"passenger-car\"\n }\n ],\n \"version\": \"v2\",\n \"effective_date\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"policy_holder_id": "policy-holder-123",
"vehicle_risk_scores": [
{
"vehicle_id": "vehicle-123",
"vehicle_risk_score": 0.621,
"metadata": {
"coverage": [
{
"usstate": "OH",
"years": [
2020,
2021,
2022,
2023
]
}
],
"effective_date": "2020-01-01T00:00:00",
"garaging_location": {
"latitude": 39.9526,
"longitude": -95.96728,
"urbanicity": "rural",
"usstate": "OH"
}
}
}
],
"errors": null,
"job_type": "ppa-garaging-risk-score",
"version": "v1"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}PPA Garaging Risk Score
Calculate Risk Score
POST
/
v1
/
risk-score
/
ppa-garaging
Calculate Risk Score
curl --request POST \
--url https://api.example.com/v1/risk-score/ppa-garaging \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"policy_holder_id": "policy-holder-123",
"vehicles": [
{
"vehicle_id": "vehicle-123",
"garaging_location": {
"latitude": 36.890333,
"longitude": -95.967285
},
"body_type": "passenger-car"
}
],
"version": "v2",
"effective_date": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.example.com/v1/risk-score/ppa-garaging"
payload = {
"policy_holder_id": "policy-holder-123",
"vehicles": [
{
"vehicle_id": "vehicle-123",
"garaging_location": {
"latitude": 36.890333,
"longitude": -95.967285
},
"body_type": "passenger-car"
}
],
"version": "v2",
"effective_date": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
policy_holder_id: 'policy-holder-123',
vehicles: [
{
vehicle_id: 'vehicle-123',
garaging_location: {latitude: 36.890333, longitude: -95.967285},
body_type: 'passenger-car'
}
],
version: 'v2',
effective_date: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.example.com/v1/risk-score/ppa-garaging', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/risk-score/ppa-garaging",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'policy_holder_id' => 'policy-holder-123',
'vehicles' => [
[
'vehicle_id' => 'vehicle-123',
'garaging_location' => [
'latitude' => 36.890333,
'longitude' => -95.967285
],
'body_type' => 'passenger-car'
]
],
'version' => 'v2',
'effective_date' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/risk-score/ppa-garaging"
payload := strings.NewReader("{\n \"policy_holder_id\": \"policy-holder-123\",\n \"vehicles\": [\n {\n \"vehicle_id\": \"vehicle-123\",\n \"garaging_location\": {\n \"latitude\": 36.890333,\n \"longitude\": -95.967285\n },\n \"body_type\": \"passenger-car\"\n }\n ],\n \"version\": \"v2\",\n \"effective_date\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/risk-score/ppa-garaging")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"policy_holder_id\": \"policy-holder-123\",\n \"vehicles\": [\n {\n \"vehicle_id\": \"vehicle-123\",\n \"garaging_location\": {\n \"latitude\": 36.890333,\n \"longitude\": -95.967285\n },\n \"body_type\": \"passenger-car\"\n }\n ],\n \"version\": \"v2\",\n \"effective_date\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/risk-score/ppa-garaging")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"policy_holder_id\": \"policy-holder-123\",\n \"vehicles\": [\n {\n \"vehicle_id\": \"vehicle-123\",\n \"garaging_location\": {\n \"latitude\": 36.890333,\n \"longitude\": -95.967285\n },\n \"body_type\": \"passenger-car\"\n }\n ],\n \"version\": \"v2\",\n \"effective_date\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"policy_holder_id": "policy-holder-123",
"vehicle_risk_scores": [
{
"vehicle_id": "vehicle-123",
"vehicle_risk_score": 0.621,
"metadata": {
"coverage": [
{
"usstate": "OH",
"years": [
2020,
2021,
2022,
2023
]
}
],
"effective_date": "2020-01-01T00:00:00",
"garaging_location": {
"latitude": 39.9526,
"longitude": -95.96728,
"urbanicity": "rural",
"usstate": "OH"
}
}
}
],
"errors": null,
"job_type": "ppa-garaging-risk-score",
"version": "v1"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
application/json
Response
Successful Response

