Threads (Laravel Forum 7.x)
Threads
Endpoint paths are prefixed with the forum.router.prefix config value (/forum/api by default).
# Fetch recent
GET /thread/recent Returns: a collection of threads updated since forum.general.old_thread_threshold.
# Fetch unread
GET /thread/unread Returns: a collection of threads that are updated or unread for the authenticated user.
# Mark as read
PATCH /thread/unread/mark-as-read Marks the authenticated user’s unread/updated threads as read.
Returns: a “success” response if successful.
# Fetch
GET /thread/{id:int} Returns: the thread specified by {id} if found and accessible, otherwise a 404 error.
# Lock
POST /thread/{id:int}/lock Locks the thread specified by {id}.
Returns: the updated thread object if successful.
# Unlock
POST /thread/{id:int}/unlock Unlocks the thread specified by {id}.
Returns: the updated thread object if successful.
# Pin
POST /thread/{id:int}/pin Pins the thread specified by {id}.
Returns: the updated thread object if successful.
# Unpin
POST /thread/{id:int}/unpin Unpins the thread specified by {id}.
Returns: the updated thread object if successful.
# Rename
POST /thread/{id:int}/rename Renames the thread specified by {id}. See parameter list below.
Parameters
| Name | Type | Description |
|---|---|---|
title | String (required) | Thread title |
Returns: the updated thread object if successful.
# Move
POST /thread/{id:int}/move Moves the thread specified by {id}. See parameter list below.
Parameters
| Name | Type | Description |
|---|---|---|
category_id | Integer (required) | Destination category ID |
Returns: the updated thread object if successful.
# Delete
DELETE /thread/{id:int} Deletes the thread specified by {id}. See parameter list below.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
permadelete | Boolean | Force hard-deletion | Always true if soft-deletion is disabled, otherwise false |
Returns: the deleted thread object if successful.
# Restore
POST /thread/{id:int}/restore Restores the soft-deleted thread specified by {id}.
Returns: the restored thread object if successful.
# Fetch posts
GET /thread/{id:int}/posts Returns: a paginated collection of posts belonging to the thread specified by {id}.
# Store post
POST /thread/{id:int}/posts Creates a post in the thread specified by {id}. See parameter list below.
Parameters
| Name | Type | Description |
|---|---|---|
content | String (required) | Post content |
Returns: the created post object if successful.
# Bulk move
POST /bulk/thread/move Moves a selection of one or more threads. Any threads not eligible for selection are left unchanged. See parameter list below.
Parameters
| Name | Type | Description |
|---|---|---|
threads | Integer array (required) | IDs of threads to move |
category_id | Integer (required) | Destination category ID |
Returns: a “success” response if successful.
# Bulk lock
POST /bulk/thread/lock Locks a selection of one or more threads. Any threads not eligible for selection are left unchanged. See parameter list below.
Parameters
| Name | Type | Description |
|---|---|---|
threads | Integer array (required) | IDs of threads to lock |
Returns: a “success” response if successful.
# Bulk unlock
POST /bulk/thread/unlock Unlocks a selection of one or more threads. Any threads not eligible for selection are left unchanged. See parameter list below.
Parameters
| Name | Type | Description |
|---|---|---|
threads | Integer array (required) | IDs of threads to unlock |
Returns: a “success” response if successful.
# Bulk pin
POST /bulk/thread/pin Pins a selection of one or more threads. Any threads not eligible for selection are left unchanged. See parameter list below.
Parameters
| Name | Type | Description |
|---|---|---|
threads | Integer array (required) | IDs of threads to pin |
Returns: a “success” response if successful.
# Bulk unpin
POST /bulk/thread/unpin Unpins a selection of one or more threads. Any threads not eligible for selection are left unchanged. See parameter list below.
Parameters
| Name | Type | Description |
|---|---|---|
threads | Integer array (required) | IDs of threads to unpin |
Returns: a “success” response if successful.
# Bulk delete
DELETE /bulk/thread Deletes a selection of one or more threads. Any threads not eligible for selection are left unchanged. See parameter list below.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
threads | Integer array (required) | IDs of threads to delete | N/A |
permadelete | Boolean | Force hard-deletion | Always true if soft-deletion is disabled, otherwise false |
Returns: a “success” response if successful.
# Bulk restore
POST /bulk/thread/restore Restores a selection of one or more soft-deleted threads. Any threads not eligible for selection are left unchanged. See parameter list below.
Parameters
| Name | Type | Description |
|---|---|---|
threads | Integer array (required) | IDs of threads to restore |
Returns: a “success” response if successful.