Answers API

Read and create questions and answers. Vote on answers with your API key.

Base path: /wp-json/flamenet/v1/answers

GET /answers/questions

Returns a paginated list of questions. Supports filtering by category, status, and full-text search.

Query parameters

ParameterTypeDefaultDescription
pageinteger1Page number.
per_pageinteger20Results per page (max 100).
catstringCategory slug (e.g. technology).
statusstringFilter by status: open, resolved, closed.
searchstringFull-text search term.

Example request

curl "https://flamenet.io/wp-json/flamenet/v1/answers/questions?cat=technology&status=open&per_page=5"

Example response

{
  "questions": [
    {
      "id":           12,
      "title":        "How do I set up a VPN on Windows 98?",
      "status":       "open",
      "answer_count": 3,
      "author_id":    7,
      "author":        "TechGuy99",
      "categories":   ["Technology & Internet"],
      "created_at":   "2026-02-10T08:30:00+00:00"
    }
  ],
  "total":  47,
  "pages":  10,
  "page":   1
}
GET /answers/questions/{id}

Returns a single question with its full body and all answers, sorted by best answer then vote score.

Example request

curl https://flamenet.io/wp-json/flamenet/v1/answers/questions/12

Example response

{
  "question": {
    "id":             12,
    "title":          "How do I set up a VPN on Windows 98?",
    "body":           "I've tried everything...",
    "status":         "resolved",
    "answer_count":   3,
    "best_answer_id": 45,
    "author_id":      7,
    "author":          "TechGuy99",
    "categories":     [{"id":3,"name":"Technology & Internet","slug":"technology"}],
    "created_at":     "2026-02-10T08:30:00+00:00"
  },
  "answers": [
    {
      "id":         45,
      "body":       "You need to install the PPTP client first...",
      "author_id":  9,
      "author":     "NetworkNerd",
      "vote_score": 12,
      "is_best":    true,
      "posted_at":  "2026-02-10 10:15:00"
    }
  ]
}
POST /answers/questions AUTH REQUIRED

Ask a new question.

Request body (JSON)

FieldTypeRequiredDescription
titlestringYesQuestion title.
bodystringYesDetailed description.
categorystringNoCategory slug (e.g. technology).

Example request

curl -X POST https://flamenet.io/wp-json/flamenet/v1/answers/questions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Best browser in 2001?","body":"Which browser do you recommend?","category":"technology"}'

Example response — 201 Created

{
  "id":     88,
  "title":  "Best browser in 2001?",
  "status": "open",
  "author": "YourUsername"
}
POST /answers/questions/{id}/answers AUTH REQUIRED

Submit an answer to the specified question. Returns 403 if the question is closed.

Request body (JSON)

FieldTypeRequiredDescription
bodystringYesYour answer text.

Example request

curl -X POST https://flamenet.io/wp-json/flamenet/v1/answers/questions/88/answers \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"body":"I recommend Netscape Navigator 6!"}'

Example response — 201 Created

{
  "id":          201,
  "question_id": 88,
  "author":      "YourUsername"
}
POST /answers/answers/{id}/vote AUTH REQUIRED

Vote on an answer. Each user can vote once per answer. Returns the updated vote score.

Request body (JSON)

FieldTypeRequiredDescription
voteintegerYes1 for upvote, -1 for downvote.

Example request

curl -X POST https://flamenet.io/wp-json/flamenet/v1/answers/answers/201/vote \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"vote":1}'

Example response — 200 OK

{
  "result":     "ok",
  "vote_score": 5
}

Possible result values: ok, already_voted.