# SMF Fan Response - DMP Participants API Test

Quick test script for the new DMP Artists Participants endpoint.

## Quick Start

```bash
# 1. Install dependencies
pip install -r requirements.txt

# 2. Configure Auth0 credentials (choose one method)

# Method A: Using .env file (recommended)
cp .env.example .env
# Edit .env and add your Auth0 credentials

# Method B: Using environment variables
export AUTH0_CLIENT_ID='your-client-id'
export AUTH0_CLIENT_SECRET='your-client-secret'

# 3. Run test
python test_dmp_participants.py
```

### Get Auth0 Credentials

Get from:
1. **Auth0 Dashboard**: https://manage.auth0.com
2. **Fansifter team**: Ask for QA M2M credentials
3. **AWS Secrets Manager**: `qa/ows-*/AUTH0_*`

## Endpoint

**URL:** `https://qa-fan-response-api.theorchard.io/external/roster`

**Method:** GET

**Auth:** Bearer token (Auth0 JWT)

**IP Whitelist:** SMF IPs only (configured in WAF)

## Query Parameters (all optional)

- `vendorId` (int) - Filter by vendor
- `subaccountId` (int) - Filter by subaccount
- `search` (string) - Search by name
- `limit` (int, 1-200) - Page size
- `offset` (int, ≥0) - Page offset

## Example curl

```bash
export TOKEN="your-jwt-token"

curl -X GET "https://qa-fan-response-api.theorchard.io/external/roster?limit=10" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
```

## Documentation

See [TEST_README.md](./TEST_README.md) for detailed documentation.

## Architecture

```
API Gateway → WAF (IP check) → JWT Authorizer → VPC Link → NLB → ALB → OWS DMP
```

## Related Terraform

- Infrastructure: `/terraform-infra/qa/lambda-fan-response/`
- PR: Check terraform-infra repository for deployment status
