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:
- API Key: Contact support to obtain your API key
- Development Environment: Go 1.21+ or Node.js 18+ depending on your chosen SDK
- Go
- TypeScript
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
1. Install the TypeScript SDK
npm install @silentwitness/typescript-sdk
2. Create your first client
import { SilentWitnessClient } from "@silentwitness/typescript-sdk";
// Initialize the API client
const client = new SilentWitnessClient({
apiKey: "your-api-key",
});
// Create a new case
async function createCase() {
try {
const response = await client.cases.createCase({
name: "Smith v. Johnson - Rear-End Collision",
clientName: "Jane Smith"
});
console.log("Case created successfully");
console.log("Case ID:", response.case?.id);
console.log("Status:", response.case?.status);
} catch (error) {
console.error("Failed to create case:", error);
}
}
createCase();
3. Run your application
npx tsx index.ts
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:
- Authentication Guide - Learn about securing your API requests
- API Reference - Explore all available endpoints and their parameters
- Error Handling - Learn how to handle errors gracefully in your applications
- Rate Limiting - Understand rate limits and how to handle them
Common Issues
Connection Errors
If you're getting connection errors, check:
- Network Access: Ensure your environment can reach
core.silentwitness.ai - Firewall Rules: Check if your network allows HTTPS connections
- DNS Resolution: Verify that the API domain resolves correctly
Authentication Errors
If you're getting authentication errors:
- API Key Format: Ensure your API key starts with
sk- - API Key Validity: Check that your API key hasn't been revoked
- Client Configuration: Verify the API key is correctly set in your client
Rate Limiting
If you're hitting rate limits:
- Implement Backoff: Add exponential backoff when receiving rate limit errors
- Monitor Usage: Track your API usage to stay within limits
- Request Increase: Contact support if you need higher rate limits
Getting Help
- Documentation - Browse the complete documentation
- Examples - See more code examples
- Support - Contact our support team