curl -X POST "https://yoursite.com/api/knowledge_base" \
-H "authtoken: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "subject": "...", "articlegroup": "..." }'
Success-Response:
HTTP/1.1 200 OK
{
"status": true,
"message": "Article added successfully",
"record_id": 12
}
Error-Response:
HTTP/1.1 422 Unprocessable Entity
{
"status": false,
"error": "validation_failed",
"message": "Article validation failed",
"errors": {
"subject": "The subject field is required.",
"articlegroup": "A valid articlegroup id is required."
}
}