Date: October 10, 2025
Endpoint Tested: POST /api/ai/articles/submit
Status: ✅ WORKING
Successfully tested the article submission endpoint with cURL and verified the API is working correctly on production.
curl -X POST "https://wegenius.fahmidsroadmap.com/api/ai/articles/submit" \
-H "Content-Type: application/json" \
-H "X-API-Key: wg_XIQRl6d1wzZvODpgpc8zaDeR4hTxpWOk" \
-H "Accept: application/json" \
-d '{
"wp_post_id": 999,
"title": "Test Article from cURL - API Verification",
"content": "This is a test article...",
"permalink": "https://wegenius.test/test-article-from-curl-verification/",
"featured_image": "https://wegenius.test/wp-content/uploads/test-image.jpg",
"status": "published",
"published_at": "2025-10-10 10:00:00",
"author_name": "Test User",
"action_type": "improve",
"meta_data": {
"categories": ["Testing"],
"tags": ["curl", "api-test"],
"excerpt": "Testing API endpoint"
},
"user_preferences": {
"focus_on": "readability",
"target_audience": "general",
"content_length": "detailed"
}
}'{
"success": true,
"message": "Article submitted for analysis",
"data": {
"analysis_id": 6,
"post_id": 8,
"wp_post_id": 999,
"title": "Test Article from cURL - API Verification",
"analysis_type": "improve",
"status": "pending",
"estimated_completion": "2025-10-10T06:15:12.844049Z"
}
}HTTP Status: 201 Created
- WRONG:
X-API-KEY(all uppercase) - CORRECT:
X-API-Key(mixed case) - Middleware Location:
app/Http/Middleware/ApiKeyAuthentication.php:19
- WRONG:
"status": "publish" - CORRECT:
"status": "published","draft", or"pending"
- WRONG:
"featured_image": false - CORRECT:
"featured_image": "https://example.com/image.jpg"ornull - Must be: A valid URL string or null (NOT a boolean)
- Valid Values:
"improve","content_gap","new_article" - INVALID:
"ideas"(this was found in some logs)
-
Authentication Header:
- Changed from
X-API-KEYtoX-API-Key
- Changed from
-
Sample Request Body:
- Changed
featured_image: false→featured_image: "https://wegenius.test/wp-content/uploads/test-image.jpg" - Changed
status: "publish"→status: "published" - Updated to use better test data
- Changed
-
Collection Description:
- Added important notes about field requirements
- Added setup instructions
- Highlighted common mistakes
-
URL Structure:
- Fixed all endpoints to include proper
hostandpatharrays - Ensured Postman correctly resolves
{{base_url}}variable
- Fixed all endpoints to include proper
Current Production Key: wg_XIQRl6d1wzZvODpgpc8zaDeR4hTxpWOk
- Site: Violet Huber
- Status: Active ✅
- Token Limit: 10,000
- Tokens Used: Available
Note: This key is for testing only. Each WordPress site should have its own unique API key.
-
✅
WeGenius_WordPress_API.postman_collection.json- Fixed authentication header name
- Updated sample request data
- Added comprehensive documentation
-
✅
test-api-submit.sh- Updated with correct field values
- Added usage notes
- Fixed header name
-
✅
get-api-key.php- Created script to fetch API keys from database
- Useful for testing and debugging
- Import
WeGenius_WordPress_API.postman_collection.jsoninto Postman
- Click on the collection name
- Go to "Variables" tab
- Update
api_keywith your actual API key from:
- The collection automatically uses the
X-API-Keyheader - Base URL is already set to production
- All endpoints are ready to test
- Ensure
statusis:published,draft, orpending - Ensure
featured_imageis a URL string ornull - Ensure
action_typeis:improve,content_gap, ornew_article
Solution:
- Check header name is
X-API-Key(case-sensitive) - Verify API key is correct
- Ensure WordPress site is active
Solution:
- Change
"status": "publish"to"status": "published"
Solution:
- Change
"featured_image": falseto a valid URL ornull - Example:
"featured_image": "https://example.com/image.jpg"
Solution:
- Check token usage in dashboard
- Upgrade plan or wait for reset
- ✅ API endpoint verified and working
- ✅ Postman collection updated and uploaded
- ✅ Test script created and uploaded
- ⏳ Monitor cron job execution at: https://wegenius.fahmidsroadmap.com/cron-status.php
- ⏳ Test complete workflow: Submit → Process → Display Suggestions
- API endpoint accessible
- Authentication working with correct header
- Article submission creates analysis record
- Response includes analysis_id and estimated_completion
- HTTP 201 status returned on success
- Field validation working correctly
- Cron job processes queued analysis
- Suggestions generated and stored
- Suggestions display correctly in dashboard
- Suggestion implementation works
Test Conducted By: AI Assistant
Production URL: https://wegenius.fahmidsroadmap.com
Documentation: API_DOCUMENTATION.md