Rest Api

EasyDiscuss 4 includes a simple REST api that allows you to connect to EasyDiscuss to perform various tasks.

Posts Listing

In this section, we will briefly explain the REST API to retrieve the Post Listing.

This REST API call allows requester to list the recent discussion created on the site. To retrieve the list of discussion, requester will need to send a GET request to the following url:

http://site.com/index.php?option=com_easydiscuss&view=index&format=json&tmpl=component

GET Parameters

The following are the available parameters when a GET is made to this API call:

  • sort (optional)
    This sort parameter is optional and the default value is latest.
  • filter (optional)
    This filter parameter is optional and the default value is unfiltered.

Response

Upon successful request, EasyDiscuss system will return a response in a form of JSON to the requester.

The successful request response will looks similar as below:

{
  "posts": [
    {
      "id": "122",
      "permalink": "http://easydiscuss.com/index.php?option=com_easydiscuss&view=post&id=122&Itemid=736?format=json",
      "title": "testing post by admin",
      "user_id": "549",
      "hits": "5",
      "vote": "0",
      "state": "1",
      "locked": "0",
      "created": "2016-03-20 16:35:32",
      "modified": "2016-03-20 16:35:32",
      "content": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
      "preview": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
      "replies": [
        {
          "id": "125",
          "permalink": "http://easydiscuss.com/index.php?option=com_easydiscuss&view=post&id=122&Itemid=736#reply-125?format=json",
          "title": null,
          "user_id": "549",
          "hits": "0",
          "vote": "0",
          "state": "1",
          "locked": "0",
          "created": "2016-03-21 09:56:42",
          "modified": "2016-03-21 09:56:42",
          "content": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
          "preview": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
          "replies": []
        }
      ]
    }]
 }