Rest Api

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

Authentication

Several EasyDiscuss REST API requires authentication. This authentication code will be generated by EasyDiscuss system and then be presented in the form of JSON to the requester.

Before performing any REST API calls, you will need have a valid authorization code. This code can be retrieved by exchanging the authorization token between the requester and the EasyDiscuss system. This exchange process require requester to send a POST data to the following url:

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

POST Parameters

The following are the required parameters when a POST is made to this API call:

  • username (required)
    This is the username of a registered user requesting authentication to the system.
  • password (required)
    This is the password of a registered user requesting authentication to the system.

Response

Upon successful authorization, the user's id and an auth token will be represented to the requester. These information are essential and need to be stored in a secure location because these information are another representation of password.

Upon receiving the auth token and user id, you will need to send these information on every subsequent API calls made to the system.

The successful authorization response will looks similar as below:

{
    "auth": "e18c957b5c206e170863f9e2e405912d",
    "code": 200,
    "id": "549"
}

And a fail authorization response will looks similar as below:

{
    "code": 403,
    "message": "Invalid username or password provided"
}