File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed
python/rag/healthcare-support-portal Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -1003,19 +1003,17 @@ Each service provides interactive API documentation:
10031003curl -X POST " http://localhost:8001/api/v1/auth/register" \
10041004 -H " Content-Type: application/json" \
10051005 -d ' {
1006- 1006+ "username": "dr_smith",
1007+ 10071008 "password": "secure_password",
10081009 "role": "doctor",
10091010 "department": "cardiology"
10101011 }'
10111012
10121013# Login to get JWT token
10131014curl -X POST " http://localhost:8001/api/v1/auth/login" \
1014- -H " Content-Type: application/json" \
1015- -d ' {
1016- 1017- "password": "secure_password"
1018- }'
1015+ -H " Content-Type: application/x-www-form-urlencoded" \
1016+ -d " username=dr_smith&password=secure_password"
10191017```
10201018
10211019### 2. Upload Medical Documents
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Get authentication token for dr_smith user
3+ # This script demonstrates the correct username format for API calls
4+
5+ TOKEN=$( curl -s -X POST " http://localhost:8001/api/v1/auth/login" \
6+ -H " Content-Type: application/x-www-form-urlencoded" \
7+ -d " username=dr_smith&password=secure_password" | \
8+ python3 -c " import sys, json; print(json.load(sys.stdin)['access_token'])" )
9+
10+ echo " Got auth token: ${TOKEN: 0: 20} ..."
11+
12+ # Export the token for use in other scripts
13+ export AUTH_TOKEN=" $TOKEN "
14+ echo " Token exported as AUTH_TOKEN environment variable"
15+ echo " You can now use it in other curl commands like:"
16+ echo " curl -H \" Authorization: Bearer \$ AUTH_TOKEN\" http://localhost:8002/api/v1/patients/"
You can’t perform that action at this time.
0 commit comments