Post View
In this section, we will briefly explain the REST API to view Post View.
This REST API call allows requester to view post which created on the site. To view the post, requester will need to send a GET request to this following url:
http://site.com/index.php?option=com_easydiscuss&view=post&format=json&tmpl=component
GET Parameters
The following are the available parameters when a GET is made to this API call:
id(required)
This id parameter is the post id available on the site.
Response
Upon a 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:
{
"post": {
"id": "25",
"permalink": "http://easydiscuss.com/index.php?option=com_easydiscuss&view=post&id=25&Itemid=118&format=json",
"title": "Unable to select tag for multi tag menu item",
"user_id": "959",
"hits": "4",
"vote": "0",
"state": "1",
"locked": "0",
"created": "2016-04-18 08:48:35",
"modified": "2016-04-19 04:45:01",
"content": "Unable to select tag for multi tag menu item",
"preview": "Unable to select tag for multi tag menu item",
"replies": [
{
"id": "29",
"permalink": "http://easydiscuss.com/index.php?option=com_easydiscuss&view=post&id=25&Itemid=118#reply-29&format=json",
"title": null,
"user_id": "965",
"hits": "0",
"vote": "0",
"state": "1",
"locked": "0",
"created": "2016-04-19 05:09:33",
"modified": "2016-04-19 05:09:33",
"content": "http://screencast.com/t/pPXrXtT1",
"preview": "<a href=\"http://screencast.com/t/ppxrxtt1\" >http://screencast.com/t/ppxrxtt1</a>",
"replies": [],
"comments": []
}
],
"comments": []
}
}
And a fail request response will looks similar as below:
{
"code": 404,
"message": "Sorry, but the post that you are trying to access is not available."
}