Get Result
Get the result of a accident reconstruction report. This endpoint returns the current status and a download URL when the report is completed.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
reportId | string | Yes | Unique identifier of the report |
Response
Returns:
| Field | Type | Description |
|---|---|---|
id | string | Unique report identifier |
caseId | string | Associated case ID |
type | string | Report type (technical_report) |
status | string | Current status: pending, processing, completed, failed |
reportUrl | string | URL to download the PDF (only when completed) |
caseUrl | string | URL to view case in web app |
errorMessage | string | Error details (only when failed) |
crashResults | CrashResults | Computed crash analysis values (only when completed) |
created | int64 | Unix timestamp of creation |
updated | int64 | Unix timestamp of last update |
CrashResults Structure
When the report status is completed, the crashResults field contains:
| API Field | SDK Field | Type | Description |
|---|---|---|---|
delta_v_at_peak_mph | DeltaVAtPeakMph | float | Delta-V at peak acceleration (mph) |
final_max_delta_v_mph | FinalMaxDeltaVMph | float | Final maximum Delta-V (mph) |
time_at_peak_ms | TimeAtPeakMs | float | Time at peak acceleration (milliseconds) |
time_at_final_max_ms | TimeAtFinalMaxMs | float | Time at final maximum (milliseconds) |
peak_acceleration_gs | PeakAccelerationGs | float | Peak acceleration (g's) |
pdof_degrees | PDOFDegrees | float | Principal Direction of Force angle (0-360°) |
pdof_direction | PDOFDirection | string | Human-readable direction (e.g., "Front", "Rear", "Left Side") |
processing_successful | ProcessingSuccessful | bool | Whether crash analysis processing succeeded |
tip
These values are computed automatically by ML from uploaded damage images or extracted from EDR (Event Data Recorder) data when provided. EDR data provides more precise measurements.
Examples
- Go
- TypeScript
import silentwitness "github.com/silentwitness/sw-go-sdk"
client := silentwitness.NewClient(silentwitness.Config{
APIKey: "sk_test_...",
})
defer client.Close()
report, err := client.GetReport(ctx, "report_xyz789abc")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Status: %s\n", report.Status)
switch report.Status {
case silentwitness.ReportStatusCompleted:
fmt.Printf("Report URL: %s\n", *report.ReportURL)
// Access crash analysis results
if report.CrashResults != nil {
r := report.CrashResults
if r.DeltaVAtPeakMph != nil {
fmt.Printf("Delta-V at Peak: %.2f mph\n", *r.DeltaVAtPeakMph)
}
if r.FinalMaxDeltaVMph != nil {
fmt.Printf("Final Max Delta-V: %.2f mph\n", *r.FinalMaxDeltaVMph)
}
if r.PeakAccelerationGs != nil {
fmt.Printf("Peak Acceleration: %.2f g's\n", *r.PeakAccelerationGs)
}
if r.PDOFDegrees != nil {
fmt.Printf("PDOF: %.0f° (%s)\n", *r.PDOFDegrees, *r.PDOFDirection)
}
}
case silentwitness.ReportStatusFailed:
if report.ErrorMessage != nil {
fmt.Printf("Error: %s\n", *report.ErrorMessage)
}
}
import { SilentWitnessClient } from "@silentwitness/sdk";
const client = new SilentWitnessClient({
apiKey: "sk_test_..."
});
const report = await client.getReport("report_xyz789abc");
console.log(`Status: ${report.status}`);
if (report.status === "completed") {
console.log(`Report URL: ${report.reportUrl}`);
// Access crash analysis results
if (report.crashResults) {
const r = report.crashResults;
console.log(`Delta-V at Peak: ${r.deltaVAtPeakMph} mph`);
console.log(`Final Max Delta-V: ${r.finalMaxDeltaVMph} mph`);
console.log(`Peak Acceleration: ${r.peakAccelerationGs} g's`);
console.log(`PDOF: ${r.pdofDegrees}° (${r.pdofDirection})`);
}
} else if (report.status === "failed") {
console.log(`Error: ${report.errorMessage}`);
}
Errors
| Code | Description |
|---|---|
NOT_FOUND | Report does not exist |
PERMISSION_DENIED | Insufficient permissions |
UNAUTHENTICATED | Invalid or missing API key |