Welcome to QAFlow! Ask questions and get answers from our community.

API Documentation

Build integrations and applications using the QAFlow REST API.

API Version: 1.0 REST JSON
Introduction

The QAFlow API provides programmatic access to our Q&A platform. You can retrieve questions, answers, users, tags, and more.

Base URL
https://checkqa.oyescripts.com/api.php
Request Format

All API requests should be made to the base URL with the endpoint path appended. For example:

GET https://checkqa.oyescripts.com/api.php/questions
Authentication

Public endpoints (reading data) don't require authentication. For write operations, you'll need an API key.

API Key Authentication

Include your API key in the request header:

Authorization: Bearer YOUR_API_KEY
To get an API key, go to your Profile Settings → API Keys and generate a new key.
Rate Limiting

To ensure fair usage, API requests are rate limited:

Plan Requests/Hour Requests/Day
Anonymous 60 500
Authenticated 300 5,000
Premium 1,000 50,000

Rate limit information is included in response headers:

X-RateLimit-Limit: 300
X-RateLimit-Remaining: 299
X-RateLimit-Reset: 1640000000
Error Handling

The API uses standard HTTP status codes to indicate success or failure:

Code Description
200 Success
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid or missing API key
403 Forbidden - Access denied
404 Not Found - Resource doesn't exist
429 Too Many Requests - Rate limit exceeded
500 Server Error
Error Response Format
{
    "error": true,
    "message": "Resource not found",
    "code": 404
}
Questions

Endpoints for retrieving and searching questions.

GET /questions

Retrieve a paginated list of questions.

Parameters
Parameter Type Description
page integer Page number (default: 1)
limit integer Results per page (default: 20, max: 100)
sort string Sort by: newest, votes, views, unanswered
tag string Filter by tag slug
category integer Filter by category ID
Example Request
GET /api.php/questions?page=1&limit=10&sort=newest
Example Response
{
    "success": true,
    "data": {
        "questions": [
            {
                "id": 123,
                "title": "How to implement authentication?",
                "slug": "how-to-implement-authentication",
                "content": "I'm trying to...",
                "votes": 15,
                "views": 234,
                "answers_count": 3,
                "has_accepted": true,
                "author": {
                    "id": 1,
                    "username": "john_doe",
                    "avatar": "https://..."
                },
                "tags": ["php", "authentication"],
                "created_at": "2024-01-15T10:30:00Z"
            }
        ],
        "pagination": {
            "current_page": 1,
            "total_pages": 50,
            "total_items": 500,
            "per_page": 10
        }
    }
}
GET /questions/{id}

Retrieve a single question by ID or slug.

Parameters
Parameter Type Description
id integer/string Question ID or slug
include string Include related data: answers, comments
Example Request
GET /api.php/questions/123?include=answers,comments
GET /search

Search questions, answers, and users.

Parameters
Parameter Type Description
q string Search query (required)
type string Filter by type: questions, answers, users, all
page integer Page number
Example Request
GET /api.php/search?q=authentication&type=questions
Answers

Endpoints for retrieving answers.

GET /questions/{id}/answers

Retrieve all answers for a specific question.

Parameters
Parameter Type Description
sort string Sort by: votes, newest, oldest
Example Response
{
    "success": true,
    "data": {
        "answers": [
            {
                "id": 456,
                "content": "You can implement...",
                "votes": 10,
                "is_accepted": true,
                "author": {
                    "id": 2,
                    "username": "expert_user"
                },
                "created_at": "2024-01-15T12:00:00Z"
            }
        ]
    }
}
Users

Endpoints for retrieving user information.

GET /users

Retrieve a list of users.

Parameters
sort string Sort by: reputation, newest, name
page integer Page number
GET /users/{id}

Retrieve a user's public profile.

Example Response
{
    "success": true,
    "data": {
        "id": 1,
        "username": "john_doe",
        "display_name": "John Doe",
        "avatar": "https://...",
        "bio": "Software developer",
        "reputation": 1500,
        "badges": {
            "gold": 2,
            "silver": 10,
            "bronze": 25
        },
        "questions_count": 15,
        "answers_count": 50,
        "joined_at": "2023-01-01T00:00:00Z"
    }
}
GET /tags

Retrieve a list of tags.

Parameters
sort string Sort by: popular, name, newest
page integer Page number
Example Response
{
    "success": true,
    "data": {
        "tags": [
            {
                "id": 1,
                "name": "javascript",
                "slug": "javascript",
                "description": "Questions about JavaScript",
                "questions_count": 150
            }
        ]
    }
}
GET /categories

Retrieve a list of categories.

Example Response
{
    "success": true,
    "data": {
        "categories": [
            {
                "id": 1,
                "name": "Programming",
                "slug": "programming",
                "description": "General programming questions",
                "questions_count": 500,
                "icon": "bi-code-slash"
            }
        ]
    }
}
Internal APIs

These endpoints are used internally by the application and may have limited functionality for external use.

Newsletter Subscription
POST /api/newsletter-subscribe.php

Subscribe or unsubscribe from newsletter.

Parameters
NameTypeDescription
emailstringEmail address
actionstringsubscribe|unsubscribe
frequencystringdaily|weekly|monthly (for subscribe)
Example Response
{
    "success": true,
    "message": "Successfully subscribed to newsletter"
}
Poll Voting
POST /api/poll-vote.php

Submit a vote for a poll option.

Parameters
NameTypeDescription
poll_idintegerPoll ID
option_idintegerSelected option ID
Example Response
{
    "success": true,
    "results": {
        "total_votes": 150,
        "options": [
            {"id": 1, "text": "Option A", "votes": 75, "percentage": 50},
            {"id": 2, "text": "Option B", "votes": 75, "percentage": 50}
        ]
    }
}
AI Features
POST /api/ai.php

Access AI-powered features (requires AI to be enabled in admin settings).

Available Actions
ActionDescription
spam_checkCheck content for spam
quality_checkAssess content quality
suggest_tagsGet tag suggestions for content
chatChatbot interaction
Example Request (Spam Check)
{
    "action": "spam_check",
    "content": "Your content to check..."
}
Example Response
{
    "success": true,
    "is_spam": false,
    "confidence": 0.95
}

Need Help?

If you have questions about the API or need assistance, we're here to help.

Jarvis
Hello! How can I help you today?