Discussions REST

Last modified by Simon Urli on 2022/07/25 15:03

cogThe REST services of the Discussions application
TypeOther
CategoryAPI
Developed by

Manuel Leduc

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Compatibility

12.10+

Description

This extension is under heavy development and can be highly unstable. Please use it only to perform tests on a dedicated XWiki instance.

/discussions/discussion/{reference}

GET

Retrieve a discussion object by its reference.

Parameters

  • reference: the discussion reference

Response

A discussion object containing:

  • reference: the reference of the discussion
  • title: the title of the discussion
  • description: the description of the discussion
  • updateDate: the date of the last update of the discussion, or the last date of addition of a message to the discussion
  • mainDocument: the reference of the XWiki document where the discussion can be viewed by default

/discussions/livetable

GET

Retrieve a Livetable Macro object, providing the list of discussions liked to the provided discussion context reference.
The results are sorted in descending order by the update date of the discussions.

Parameters

  • type: the type of the requested discussion context
  • reference: the reference value of the requested discussion context
  • limit: the pagination limit
  • offset: the pagination offset
  • reqNo: the request number, provided by the livetable when sending a query
  • linkTemplate: the template used to generate the links to the discussions. The REFERENCE substring of the template is replaced by the reference of the discussions when generating the discussion links
  • jokerAllowed: when true, the '*' value will also be used in addition to the reference when querying the discussions

Response

A live table result containing:

  • reqNo: the reqNo provided in parameters
  • returnedrows: the number of returned rows 
  • totalrows: the total number of rows
  • rows: an array of row objects, see below for the detail of the field of the objects contained in the array
  • offset: the current offset

The content of the rows:

  • title: the title of the discussion
  • title_url: the link to the page of the discussion
  • updateDate: the last update date of the discussion (format: yyyy/MM/dd HH:mm)
  • messageCount: the number of messages of the discussion
  • doc_viewable: Always true. This values is request by the livetable macro to displat the title URLs.

/discussions/listusers

GET

Retrieve a Livetable Macro object, providing the list of users involved in a given discussion.

Parameters

  • type: the type of the discussion
  • reference: the reference of the discussion
  • limit: the pagination limit
  • offset: the pagination offset
  • reqNo: the request number, provided by the livetable when sending a query

Response

A live table result containing:

  • reqNo: the reqNo provided in parameters
  • returnedrows: the number of returned rows 
  • totalrows: the total number of rows
  • rows: an array of row objects, see below for the detail of the field of the objects contained in the array
  • offset: the current offset

The content of the rows:

  • name: the name of the actor
  • name_link: the link to the profile page of the actor
  • doc_viewable: Always true. This values is request by the livetable macro to displat the title URLs.

/discussions/discussion

POST

Creates a discussion.

Parameters

A discussion creation object with the following fields:

  • title: the title of the discussion
  • description: the description of the discussion
  • mainDocument: the main document to view the discussion
  • XWiki 2.0+  applicationHint (optional): hint of the application for which the discussion is created 
  • XWiki 2.0+  storeConfigurationParameters (optional): map of parameters that are used in the configuration for chosing where the discussion should be stored 

Response

A discussion object containing the following fields:

  • reference: the reference of the discussion
  • title: the title of the discussion
  • description: the description of the discussion
  • updateDate: the update date of the discussion, in this context this is also its creation date
  • mainDocument: the main document to view the discussion

Get Connected