# ASN Backend API - Postman Collection Setup Guide

This guide will help you set up and use the ASN Backend API Postman collection.

## Files
- `ASN_Backend_API_Complete.postman_collection.json` - Complete collection of API endpoints
- `ASN_Backend_API_Environment.postman_environment.json` - Environment variables

## Setup Instructions

### 1. Import Collection and Environment
1. Open Postman
2. Click the "Import" button (top left)
3. Drag and drop both JSON files or browse to select them
4. Click "Import"

### 2. Configure Environment
1. In the top-right corner, select "ASN Backend API Environment" from the dropdown
2. Click the 👁️ (eye) icon next to the environment dropdown
3. Set values for the variables:
   - `base_url`: URL of your API server (default: http://localhost:8000)
   - `token`: Your authentication token (obtained after login)
   - `customer_token`: Your customer API token

### 3. Authentication
To get your authentication token:
1. Navigate to the "Authentication" folder in the collection
2. Select the "Login" request
3. Fill in your credentials in the request body
4. Click "Send"
5. From the response, copy the token value
6. Set it as the `token` variable in your environment

### 4. Using the Collection
The collection is organized into folders:
- **Authentication**: Register, login, logout
- **Quizzes**: Quiz listings, details, questions
- **Categories**: Category listings and details
- **Questions**: Question details and answer checking
- **Customer Recommendations**: Personalized quiz recommendations
- **Customer Quizzes**: Quiz interaction endpoints

For each request:
1. Make sure you've selected the "ASN Backend API Environment"
2. Check that your authentication token is set
3. Click "Send" to execute the request

### 5. Authorization
Most endpoints require authentication. When using these endpoints:
- Ensure your token is set in the environment
- Each request includes the Authorization header automatically

## Note
- The customer recommendation endpoints use `customer_token` which may differ from the regular authorization token
- For endpoints that require path parameters (like IDs), replace them with actual values before sending requests 