{ "questions": [ { "id": "q-123", "user_id": "user-456", "user": { "id": "user-456", "username": "biologystudent" }, "title": "What is the difference between mitosis and meiosis?", "details": "I'm confused about the key differences between these two processes. Can someone explain?", "tags": ["Biology", "Cell Division"], "created_at": "2024-01-15T10:30:00Z", "answers": [ { "id": "a-789", "question_id": "q-123", "user_id": "user-101", "user": { "id": "user-101", "username": "biologyexpert" }, "text": "Mitosis produces two identical daughter cells with the same number of chromosomes, while meiosis produces four genetically different cells with half the chromosomes.", "vote_count": 5, "created_at": "2024-01-15T11:00:00Z" } ] } ]}
Endpoints
Community Forum
Q&A forum with questions, answers, upvotes, and reputation system
{ "questions": [ { "id": "q-123", "user_id": "user-456", "user": { "id": "user-456", "username": "biologystudent" }, "title": "What is the difference between mitosis and meiosis?", "details": "I'm confused about the key differences between these two processes. Can someone explain?", "tags": ["Biology", "Cell Division"], "created_at": "2024-01-15T10:30:00Z", "answers": [ { "id": "a-789", "question_id": "q-123", "user_id": "user-101", "user": { "id": "user-101", "username": "biologyexpert" }, "text": "Mitosis produces two identical daughter cells with the same number of chromosomes, while meiosis produces four genetically different cells with half the chromosomes.", "vote_count": 5, "created_at": "2024-01-15T11:00:00Z" } ] } ]}
curl -X POST https://api.inspir.uk/api/forum/questions/q-123/answers \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "text": "Photosynthesis is the process by which plants convert light energy into chemical energy." }'
Add an answer to a question. Requires authentication.
Created answer object with vote_count initialized to 0
{ "answer": { "id": "a-790", "question_id": "q-123", "user_id": "user-101", "user": { "id": "user-101", "username": "biologyexpert" }, "text": "Photosynthesis is the process by which plants convert light energy into chemical energy.", "vote_count": 0, "created_at": "2024-01-15T12:30:00Z" }}