Base URL: /wp-json/oforum/v1/
All write endpoints require WordPress authentication (nonce via X-WP-Nonce header, or cookie-based auth).
Rooms
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /rooms | None | List all rooms |
| GET | /rooms/{id} | None | Get single room |
| POST | /rooms | Admin | Create room |
| PUT | /rooms/{id} | Admin | Update room |
| DELETE | /rooms/{id} | Admin | Delete room |
Threads
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /threads?room_id=X | None | List threads (paginated) |
| GET | /threads/{id} | None | Get single thread |
| POST | /threads | Logged in | Create thread |
| PUT | /threads/{id} | Author or Mod | Update thread |
| DELETE | /threads/{id} | Moderator | Delete thread |
Create thread body:
json{
"title": "My thread title",
"content": "<p>Thread content</p>",
"type": "discussion",
"room_id": 5
}
Replies
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /replies/{id} | None | Get single reply |
| POST | /replies | Logged in | Post reply |
| PUT | /replies/{id} | Author (within window) | Edit reply |
| DELETE | /replies/{id} | Author or Mod | Delete reply |
Create reply body:
json{
"thread_id": 42,
"parent_id": 0,
"content": "<p>My reply</p>"
}
Reactions
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /reactions | Logged in | Toggle reaction |
Body: { "reply_id": 42, "emoji": "👍" }
Response: { "action": "added", "counts": { "👍": 3, "❤️": 1 } }
Search
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /search?q=term | None | Full-text search |
Query params: q, room_id, page, per_page
