Skip to main content

Overview

The Assessment APIs provide comprehensive functionality for the Strength Finder personality assessment system, including saving assessment results, retrieving assessment data, clearing data, and generating PDF reports.

Base URL

https://talentg.vercel.app/api

Authentication

All assessment endpoints require user authentication. Users must be signed in to save or access their assessment data.
Authorization: Bearer <supabase_jwt_token>
Content-Type: application/json

Strength Finder Assessment

Save Assessment Results

Get Assessment Results

Get Pre-assessment Data

PDF Generation

Request PDF Generation

Check PDF Status

PDF Cleanup

Test Endpoints

Test PDF Generation

Test Google Services

Error Handling

Common Error Codes

CodeHTTP StatusDescription
UNAUTHORIZED401User not authenticated
VALIDATION_ERROR400Invalid input data
NOT_FOUND404Assessment not found
PDF_GENERATION_FAILED500PDF generation process failed
STORAGE_ERROR500File storage operation failed

Error Response Format

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid assessment data",
    "details": {
      "field": "overallScore",
      "message": "Score must be between 0 and 100"
    }
  }
}

Rate Limiting

  • Save assessment: 10 requests per hour per user
  • Get assessment data: 100 requests per hour per user
  • PDF generation: 5 requests per hour per user
  • Status checks: 200 requests per hour per user

SDK Examples

const saveAssessment = async (assessmentData) => {
  const token = await getSupabaseToken();

  const response = await fetch('/api/assessments/strength-finder/save', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(assessmentData)
  });

  return response.json();
};

// Usage
const result = await saveAssessment({
  name: "John Doe",
  category: "working_professional",
  overallScore: 85,
  starRating: 4,
  sectionScores: [...],
  completedAt: new Date().toISOString()
});

Assessment Categories

The following categories are supported for Strength Finder assessments:
CategoryTarget Audience
class_3_5Students in grades 3-5
class_6_8Students in grades 6-8
class_9_12Students in grades 9-12
graduateRecent graduates
postgraduatePostgraduate students
working_professionalWorking professionals

PDF Generation Process

  1. Assessment Completion: User completes the assessment
  2. Data Save: Assessment data is saved to database
  3. PDF Request: User requests PDF generation
  4. Processing: AI analysis and PDF generation (2-5 minutes)
  5. Storage: PDF is stored and URL provided
  6. Download: User can download the completed report
PDF generation is a resource-intensive process. Users are limited to 5 PDF generations per hour.