Date: 2025-11-07 Status: ✅ FIXED Issue: 404 Error when fetching task JSON URLs
The application was returning a 404 error when trying to fetch task JSON URLs from the WordPress REST API:
Error: Failed to get JSON URLs: 404
The wordpress.ts API client was using incorrect endpoint URLs. The implementation was using the generic ypai/v1 namespace instead of the correct ypai-video/v1 namespace from the YPAI Video Uploader Plugin v1.2.0.
Wrong Endpoints:
/wp-json/ypai/v1/json-urls ❌/wp-json/ypai/v1/upload-urls ❌/wp-json/ypai/v1/verify-uploads ❌Correct Endpoints:
/wp-json/ypai-video/v1/task-json-urls ✅/wp-json/ypai-video/v1/upload-urls ✅/wp-json/ypai-video/v1/verify-uploads ✅src/api/getreal/wordpress.ts)Fixed three endpoint URLs:
Line 17 - getTaskJsonUrls():
// BEFORE (wrong)
const url = `${getBaseUrl()}/wp-json/ypai/v1/json-urls?participant_id=${encodeURIComponent(
participantId
)}&secret=${encodeURIComponent(SECRET)}`;
// AFTER (correct)
const url = `${getBaseUrl()}/wp-json/ypai-video/v1/task-json-urls?participant_id=${encodeURIComponent(
participantId
)}&secret=${encodeURIComponent(SECRET)}`;
Line 38 - getUploadUrls():
// BEFORE (wrong)
const url = `${getBaseUrl()}/wp-json/ypai/v1/upload-urls?secret=${encodeURIComponent(SECRET)}`;
// AFTER (correct)
const url = `${getBaseUrl()}/wp-json/ypai-video/v1/upload-urls?secret=${encodeURIComponent(SECRET)}`;
Line 64 - verifyUploads():
// BEFORE (wrong)
const url = `${getBaseUrl()}/wp-json/ypai/v1/verify-uploads?secret=${encodeURIComponent(SECRET)}`;
// AFTER (correct)
const url = `${getBaseUrl()}/wp-json/ypai-video/v1/verify-uploads?secret=${encodeURIComponent(SECRET)}`;
src/config/getreal.config.ts)Updated endpoint documentation:
wordpress: {
baseUrl: 'https://yourpersonalai.net',
endpoints: {
taskJsonUrls: '/wp-json/ypai-video/v1/task-json-urls', // ← Updated
uploadUrls: '/wp-json/ypai-video/v1/upload-urls', // ← Updated
verifyUploads: '/wp-json/ypai-video/v1/verify-uploads', // ← Updated
},
},
src/pages/getreal/README.md)Updated API documentation section to reflect correct endpoints and plugin version:
Endpoints (YPAI Video Uploader Plugin v1.2.0):
- `/wp-json/ypai-video/v1/task-json-urls?participant_id={id}` - Get task JSON URLs
- `/wp-json/ypai-video/v1/upload-urls` - Get presigned S3 upload URLs
- `/wp-json/ypai-video/v1/verify-uploads` - Verify all uploads complete
src/pages/getreal/IMPLEMENTATION-COMPLETE.md)Marked WordPress endpoints as fixed and updated documentation.
Plugin Name: YPAI Video Uploader
Version: v1.2.0
Namespace: ypai-video/v1
GET /wp-json/ypai-video/v1/task-json-urls
participant_id (required)secret (required)POST /wp-json/ypai-video/v1/upload-urls
secret (required, query param){
"participant_id": "01234",
"files": [
{
"task_uuid": "uuid-here",
"file_name": "video.webm",
"content_type": "video/webm"
}
]
}
POST /wp-json/ypai-video/v1/verify-uploads
secret (required, query param){
"participant_id": "01234",
"uploaded_videos": [
{
"task_uuid": "uuid-here",
"uploaded_at": "2025-11-07T12:00:00.000Z"
}
],
"source": "Prolific",
"prolific_pid": "ABC123"
}
{
"success": true,
"completion_url": "https://prolific.co/..."
}
✅ Dev server running on http://localhost:4065/
/getreal/camera-test - Camera validation page/getreal/consent - Typeform consent form/getreal/record - Recording interface (now with correct API endpoints)Test with Real Participant ID:
http://localhost:4065/getreal/record?participant_id=01234&session_id=test-session&source=Prolific
Verify API Calls:
/wp-json/ypai-video/v1/task-json-urlsTest Full Flow:
Documentation: T:\Obsidian\YPAI\Clients\GetReal Labs\Gesture Data Collection\Gesture Data Collection.md
This Obsidian document contains the complete WordPress plugin documentation including:
✅ Resolved: 404 errors when fetching task JSON URLs ✅ Benefit: Application can now communicate with WordPress REST API ✅ Next: Ready for end-to-end participant flow testing
Fix Applied: 2025-11-07 Files Modified: 4 (wordpress.ts, getreal.config.ts, README.md, IMPLEMENTATION-COMPLETE.md) Lines Changed: 12 lines across 4 files