Dandelion - API Documentation - Comments

Module name: comments

Index

add

Endpoint: /api/comments/add

Method: POST

Parameters: [logid], [comment]

Parameter Type Default Required
logid int   true
comment string   true

Description: Create a new comment on the given log.

Example Return Data:

{
	"data": "Comment created successfully"
}

Permissions Needed:

  • Add Comment

⇑ Top


get

Endpoint: /api/comments/get

Method: GET

Parameters: [logid], [order]

Parameter Type Default Required
logid int   true
order string ‘new’ false

Description: Retrieve comments for a log entry. order can be either ‘new’ or ‘old’ to sort the comments.

Example Return Data:

{
	"data": [
		{
			"id": 1,
			"user_id": 1,
			"comment": "Hello",
			"created": "2019-06-09 15:15:20",
			"log_id": 2,
			"fullname": "Administrator"
		}
	]
}

Returned Values:

  • id (int) - ID number of comment
  • user_id (int) - ID of user who created the comment
  • comment (string) - Comment text
  • created (string) - Date and time the comment was created ‘Y-m-d H:i:s’
  • log_id (int) - ID number of the log entry
  • fullname (string) - Name of user who created comment

Permissions Needed:

  • View logs

⇑ Top


⇐ API Documentation