Data Payloads
When a user sends audio, 8 data fields are collected and sent to the server as multipart form data.
Server Endpoint
| Field | Value |
|---|---|
| URL | http://worker1.ipnoelp.com/webhook/api/v1/voice-chat-TEST |
| Method | POST |
| Content-Type | multipart/form-data |
| Authorization | Bearer [AI Token] (NOT user JWT) |
| Timeout | 240 seconds (4 minutes) send/receive |
| Accept | application/json |
Payload 1: Audio Input
| Field | Value |
|---|---|
| Field name | audio_file |
| Format | WAV (44.1kHz, 128kbps) |
| Max duration | 2 minutes (120 seconds) |
| Filename | recording.wav |
Payload 2: Course Progress Data
| Field | Value |
|---|---|
| Field name | course_progress |
| Source | AppData/JSONs/User_Audio_Usage/[CourseCode]_Usage.json |
Example:
{
"course_code": "C14ENF",
"title": "Confidence",
"audio_files": {
"1": { "title": "How to Use These Sessions", "no_of_plays": 1 },
"2": { "title": "Release Social Anxiety", "no_of_plays": 3 },
"3": { "title": "Overcome Fear", "no_of_plays": 0 }
}
}
Code: _collectCourseProgress() at line ~1449
Payload 3: Journal Responses
| Field | Value |
|---|---|
| Field name | journal_responses |
| Source | AppData/JSONs/User_Workbook_Responses/[CourseCode]1_response.json |
Example (journal exists):
{
"has_journal": true,
"entries": {
"daily_entries": [
{
"date": "2024-11-14",
"mood_rating": "7",
"anxiety_level": 4,
"triggers": ["work_stress", "social_situations"],
"thoughts_feelings": "Felt anxious about the presentation..."
}
]
}
}
If no journal found:
{
"has_journal": false,
"entries": ["User has not used the journal yet"]
}
Code: _collectJournalResponses() at line ~1482
Payload 4: User Context
| Field | Value |
|---|---|
| Field name | user_context |
| Source | user_profile.json |
{
"current_course": "C14ENF",
"user_name": "John"
}
Code: _collectUserContext() at line ~1521
Payload 5: Conversation History
| Field | Value |
|---|---|
| Field name | conversation |
| Source | AppData/JSONs/Conversations/[CourseCode]_conversation.json |
Content is the raw JSON string of previous conversation, or "No prior conversation exists" if none.
Code: _loadConversation() at line ~1532
Payload 6: Voice Preference
| Field | Value |
|---|---|
| Field name | voice |
| Source | user_profile.json -> preferred_ai_voice |
| Default | "tara" |
User profile is reloaded before each request to get the latest voice preference.
Payload 7: Session ID
| Field | Value |
|---|---|
| Field name | session_id |
| Format | UUID v4 (generated per request) |
| Example | a1b2c3d4-e5f6-7890-abcd-ef1234567890 |
Payload 8: Timestamp
| Field | Value |
|---|---|
| Field name | timestamp |
| Format | ISO8601 |
| Example | 2024-12-23T14:30:00.000Z |