Skip to main content

Quick Start Guide

This guide will help you make your first API call using the Silent Witness SDKs in just a few minutes.

Prerequisites

Before you begin, you'll need:

  1. API Key: Contact support to obtain your API key
  2. Development Environment: Go 1.21+ or Node.js 18+ depending on your chosen SDK

1. Install the Go SDK

go get github.com/silentwitness/go-sdk

2. Create your first client

package main

import (
"context"
"fmt"
"log"

"github.com/silentwitness/go-sdk"
)

func main() {
// Initialize the API client
client := silentwitness.NewClient(silentwitness.Config{
APIKey: "your-api-key",
})

// Create a new case
ctx := context.Background()
caseResp, err := client.Cases.Create(ctx, &silentwitness.CreateCaseRequest{
Name: silentwitness.String("Smith v. Johnson - Rear-End Collision"),
ClientName: silentwitness.String("Jane Smith"),
})
if err != nil {
log.Fatalf("Failed to create case: %v", err)
}

fmt.Printf("Case created successfully\n")
fmt.Printf("Case ID: %s\n", caseResp.CaseId)
fmt.Printf("Status: %s\n", caseResp.Status)
}

3. Run your application

go run main.go

Expected Response

When you run either example, you should see output similar to:

Case created successfully
Case ID: case_1234567890abcdef
Status: active

Next Steps

Now that you've made your first API call, here's what you can explore next:

Common Issues

Connection Errors

If you're getting connection errors, check:

  1. Network Access: Ensure your environment can reach core.silentwitness.ai
  2. Firewall Rules: Check if your network allows HTTPS connections
  3. DNS Resolution: Verify that the API domain resolves correctly

Authentication Errors

If you're getting authentication errors:

  1. API Key Format: Ensure your API key starts with sk-
  2. API Key Validity: Check that your API key hasn't been revoked
  3. Client Configuration: Verify the API key is correctly set in your client

Rate Limiting

If you're hitting rate limits:

  1. Implement Backoff: Add exponential backoff when receiving rate limit errors
  2. Monitor Usage: Track your API usage to stay within limits
  3. Request Increase: Contact support if you need higher rate limits

Getting Help