-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-api-submit.sh
More file actions
54 lines (49 loc) · 2.04 KB
/
test-api-submit.sh
File metadata and controls
54 lines (49 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# Test script for WeGenius API article submission
# IMPORTANT: Get your API key from the WordPress site settings in the dashboard
# Replace YOUR_API_KEY_HERE with actual API key
API_KEY="YOUR_API_KEY_HERE"
API_URL="https://wegenius.fahmidsroadmap.com/api/ai/articles/submit"
echo "======================================"
echo "WeGenius API - Submit Article Test"
echo "======================================"
echo ""
echo "Testing endpoint: POST $API_URL"
echo ""
# Test data
curl -X POST "$API_URL" \
-H "Content-Type: application/json" \
-H "X-API-Key: $API_KEY" \
-H "Accept: application/json" \
-d '{
"wp_post_id": 999,
"title": "Test Article from cURL - API Verification",
"content": "This is a test article submitted via cURL to verify the API endpoint is working correctly. The content should be analyzed by the AI system. We are testing readability, SEO optimization, and content quality analysis features. The content needs to be long enough to provide meaningful analysis results.",
"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"
}
}' \
-w "\n\nHTTP Status Code: %{http_code}\n" \
-s
echo ""
echo "======================================"
echo "NOTES:"
echo "1. Replace YOUR_API_KEY_HERE with your actual API key"
echo "2. Get API key from: https://wegenius.fahmidsroadmap.com/wordpress-sites"
echo "3. Header name is: X-API-Key (NOT X-API-KEY)"
echo "4. status must be: published, draft, or pending (not 'publish')"
echo "5. featured_image must be a valid URL or null (not false)"
echo "======================================"