Insomnia Setup Guide
Step-by-step guide to set up Insomnia for testing the FishingLog API with Git Sync.
Prerequisites
- Insomnia installed (https://insomnia.rest/download)
- Access to AWS Cognito User Pool (for authentication)
- Local API running (for local development testing)
- GitHub repository access
Step 1: Create Project and Connect Git Sync
Create New Project
- Open Insomnia
- Click Create → New Project (or New Design Document)
- Name it:
FishingLog API - Click Create
Connect Git Sync
- In your new project, click Setup Git Sync (top right)
- Click Configure Repository
- Authenticate with GitHub (click "Authenticate with GitHub App")
- Search for
FishingLog.Backendrepository - Select it
- Important: Set Directory to
insomnia/(not root or empty) - Click Connect
Note: Insomnia may say "We didn't find any Insomnia files" - this is normal. You'll import the workspace file next. If you see "Workspace not found" error, check that the Directory is set to insomnia/ in Git Sync settings.
Step 2: Import Workspace File
- In Insomnia, right-click your project/workspace
- Import/Export → Import Data → From File
- Navigate to
insomnia/FishingLog API-wrk_a06d10d105e24bc68e7dac3e6c97f43b.yamlin your local repository - Click Import
- The requests and environments (Local, Staging, Production) will be imported into your project
Note: The filename includes the workspace ID (wrk_...). This is important for Git Sync - don't rename it!
Step 3: Push to Git
- After importing, click Sync button (top right)
- Click Push to sync your workspace to Git
- Insomnia will create workspace files in your
insomnia/directory - Future changes will sync automatically (if auto-sync is enabled)
Step 4: Configure Environments
Local Development Environment
- Click the environment dropdown (top left)
- Select Local Development
- Click the environment name to edit
- Verify these variables:
base_url: https://localhost:5100
api_url: https://localhost:5100
cognito_user_pool_id: us-east-2_TZtGx1T3X
cognito_client_id: 6i1opt39o2n5h5ihq471l1ev07
cognito_region: us-east-2
cognito_domain: us-east-2tztgx1t3x.auth.us-east-2.amazoncognito.com - Click Done
Staging Environment
- Select Staging environment
- Variables are pre-configured:
base_url: https://api-staging.reelog.app
api_url: https://api-staging.reelog.app - Same Cognito settings as Local (shared User Pool)
Production Environment
- Select Production environment (ready for when production is deployed)
- Variables are pre-configured:
base_url: https://api.reelog.app
api_url: https://api.reelog.app - Same Cognito settings as Local/Staging (shared User Pool)
Step 5: Get Authentication Token
Method 1: Using AWS CLI (Recommended)
aws cognito-idp initiate-auth \
--auth-flow USER_PASSWORD_AUTH \
--client-id 6i1opt39o2n5h5ihq471l1ev07 \
--auth-parameters USERNAME=your-username,PASSWORD=your-password \
--region us-east-2
Copy the AccessToken from the response.
Method 2: Using Cognito Hosted UI
- Visit:
https://us-east-2tztgx1t3x.auth.us-east-2.amazoncognito.com/login - Login with your credentials
- After redirect, copy the
id_tokenoraccess_tokenfrom the URL hash - Or use browser DevTools → Network → Check the token response
Add Token to Environment
Important: Use the id_token from the login response, not the access_token. The id_token contains user identity claims and is properly signed for API authentication.
- In Insomnia, click Manage Environments (environment dropdown → Manage Environments)
- Select your environment (Local or Staging)
- Click + to add new variable
- Add:
- Name:
access_token - Value: Paste the
id_tokenfrom your login response (notaccess_token)
- Name:
- Click Done
Note:
- Use
id_tokenfor API authentication (contains user claims and proper audience) access_tokenis for calling AWS services, not your API- Tokens expire after 1 hour. Use the
refresh_tokento get new tokens.
Step 6: Test the Setup
Test Health Check (No Auth)
- Select Staging environment
- Open Health & Status → Health Check
- Click Send
- Should return:
{"status":"healthy","timestamp":"..."}
Test Authenticated Endpoint
- Make sure
access_tokenis set in your environment - Open Health & Status → Ping (Authenticated)
- Click Send
- Should return:
"pong (secure)"
Test User Endpoint
- Open Users → Get Current User
- Click Send
- Should return your user information
Step 7: Add More Requests
Create New Request
- Right-click on a folder (e.g., Users)
- Select New Request
- Name it (e.g., "Get User Profile")
- Set URL:
`\{\{ _.api_url \}\}/api/userprofile/me` - Set Method:
GET - Add Header:
- Name:
Authorization - Value:
`Bearer \{\{ _.access_token \}\}`
- Name:
- Click Send to test
- Click Save (Ctrl/Cmd + S)
Organize Requests
- Create folders for different API sections
- Use descriptive names
- Add descriptions to requests
- Group related requests together
Git Sync Best Practices
- Commit regularly: Commit your Insomnia workspace changes
- Don't commit tokens: Use environment variables, not hardcoded tokens
- Share environment templates: Keep environment structure in sync
- Document custom requests: Add descriptions to requests
Troubleshooting
"Invalid token" errors
- Check that
access_tokenis set in your environment - Verify token hasn't expired (Cognito tokens expire after 1 hour)
- Regenerate token if needed
"Connection refused" (Local)
- Make sure your local API is running:
dotnet run - Check the port matches your environment (
5101for HTTP)
"502 Bad Gateway" (Staging)
- Check ECS service is running
- Verify health checks are passing
- Check CloudWatch logs for errors
Git Sync Issues
"Workspace not found" Error
- Cause: Git Sync directory doesn't match where the workspace file is located
- Fix:
- In Insomnia, go to Preferences → Data → Git Sync
- Check the Directory setting
- It should be set to
insomnia/(not root/or empty) - If it's wrong, update it to
insomnia/and click Save - Click Pull to sync the workspace file
- If still not working, try Disconnect and reconnect Git Sync with directory set to
insomnia/
"We didn't find any Insomnia files"
- This is normal on first setup
- Import the YAML workspace file manually (Step 2)
- Then push to Git (Step 3)
"Repository not found"
- Check repository URL is correct
- Verify you have access to the repository
- Try authenticating again
"Authentication failed"
- Use GitHub App authentication (recommended)
- Or create Personal Access Token with
reposcope - Make sure token hasn't expired
Environment Variables Reference
Available Variables
`\{\{ _.base_url \}\}`- Base API URL`\{\{ _.api_url \}\}`- API URL (same as base_url)`\{\{ _.cognito_user_pool_id \}\}`- AWS Cognito User Pool ID`\{\{ _.cognito_client_id \}\}`- AWS Cognito App Client ID`\{\{ _.cognito_region \}\}`- AWS Region`\{\{ _.cognito_domain \}\}`- Cognito Domain`\{\{ _.access_token \}\}`- JWT Access Token (set manually)
Usage in Requests
Use variables in URLs and headers:
URL: \{\{ _.api_url \}\}/api/user/me
Header: Bearer \{\{ _.access_token \}\}
Workspace Structure
The workspace includes comprehensive endpoint coverage:
FishingLog API/
├── Health & Status/
│ ├── Health Check (GET /health) - No auth
│ └── Ping (GET /ping) - Requires auth
├── Authentication/
│ └── Cognito Login (POST /oauth2/token)
├── Users & Profiles/
│ ├── Get Current User
│ ├── Get/Update Profile
│ └── Personal Bests
├── Fishing Logs/
│ ├── Entries (CRUD)
│ ├── Sessions
│ └── Catches
├── Social/
│ ├── Posts (CRUD, Like)
│ ├── Comments
│ └── Friends
├── Gear/
│ ├── Rods, Reels, Lines, Lures (reference)
│ ├── Boats (user-owned)
│ └── Gear Setups
├── Tournaments/
│ └── Registration
├── Spots & Reports/
│ ├── Nearby Spots
│ └── Reports by Location
├── Personal Bests/
├── Circles/
│ ├── Discover
│ ├── Create/Join
│ └── Memberships
├── Events & Clubs/
├── Reference Data/
│ ├── Brands
│ ├── Fish Species
│ └── Regulations
├── Charters/
└── Themes/
Environments:
- Local Development (
https://localhost:5100for HTTPS,http://localhost:5101for HTTP) - Staging (
https://api-staging.reelog.app) - Production (
https://api.reelog.app) - Ready for future deployment
Next Steps
- ✅ Test all existing requests
- ✅ Add requests for your most-used endpoints
- ✅ Set up Git Sync for collaboration
- ✅ Document any custom requests you add
- ✅ Share workspace with team members
Need Help? Check the main README.md or open an issue.