<< Back to GForge REST API

Entity: Forummessage

GET

getAttachment

Get the binary content or metadata for an attachment belonging to a forum message.

Parameters (3)

Name Type Description
id string Route parameter — database ID of the forum message. Required
attachmentId string Route parameter — database ID of the attachment (Filesystem record). Required
option string Delivery mode. Valid values: open (stream file, default), any other value returns the FilesystemBasic metadata object.

Return: \gforge\core\models\api\FilesystemBasic|void

Metadata object when option != open; void when streaming.

Example 1

Retrieve binary object for a specified message ID and attachment ID:
  GET http://api.mygforge.tld/forummessage/2/attachment/5/some-picture.png

getChildcount

Retrieve the number of child (reply) messages under a given forum message.

Parameters (1)

Name Type Description
id int The unique identifier for the parent forum message. Required

Return: \stdClass

Object with a single count property containing the integer child count.

getForummessage

Retrieve a single forum message by its unique identifier, or search for messages matching filter criteria.

Parameters (6)

Name Type Description
id int The unique identifier for the message. When present, search parameters are ignored.
rel string Comma-separated list of related data to include. Valid values: childcount, attachments.
sort_dir string Sort direction for search results. Valid values: asc, desc. Defaults to asc. Sort field is always id.
page_num int Zero-based page index for paged results. Defaults to 0.
page_size int Number of results per page. Defaults to 20.
thread string Thread ID to filter messages by when performing a search.

Return: \ForumMessageBasic|\ForumMessageBasic[]

getForummessagesBetweenIdsByThreadId

Retrieve a page of forum messages in a given thread with IDs less than a specified value.

Parameters (3)

Name Type Description
threadId int Database ID of the ForumThread to query. Required
before int Only messages with an ID strictly less than this value are returned. Required
page_size int Maximum number of messages to return. Defaults to 50.

Return: \ForumMessageBasic[]

Zero or more message objects, ordered by message ID.

getLocation

Retrieve the position (message number) of an individual forum message by its unique identifier.

Parameters (1)

Name Type Description
id int The unique identifier for the forum message. Required

Return: \ForumMessageBasic

The message record enriched with positional data.

POST

postAttachment

Processes a forum message attachment upload.

Creates a ForumMessage record whose body is a rendered HTML link/image tag pointing to the uploaded file, then saves the file via FilesystemService.

Parameters (1)

Name Type Description
id string Database ID of the ForumThread (not message) to attach the file to. Required

Return: array

Associative array with a location key containing the API URL of the new message.

postForummessage

Create a new Forum Message, or update an existing one.

Fields are read from the request via {@see ForumMessageBasic::FromRequest()}.

Parameters (5)

Name Type Description
id int Database ID of the message to update, or 0 to create. Defaults to 0.
subject string Subject line of the message.
body string Body text of the message.
forumThread int Database ID of the ForumThread this message belongs to. Required when creating.
parentForumMessageId int Database ID of the parent message when posting a reply. Optional.

Return: array

Associative array with a location key containing the API URL of the message.

PUT

DELETE

deleteForumMessage

Deletes a Forum Message

Records a deletion activity log entry and an audit trail entry after removal.

Parameters (1)

Name Type Description
id int The unique identifier of the forum message to delete. Required

Return: array

Associative array with a result key set to success.