training.comments

SUPPORTED METHODS:

GET

ParametersTypeDescription
token (required)Valid token
module_id (required)integerModule id
type (required)enum (1, 2)Comments type
1: Comments
2: Homework

UPDATE

ParametersTypeDescription
token (required)Valid token
module_id (required)integerModule id
type (required)enum (1, 2)Comments type
1: Comments
2: Homework
comment_id (accepted)integerComment id
status (accepted)enum (1, 2)Status
1: Accepted comment
2: Rejected comment
text (accepted)varcharComment text
user (accepted)integerUser id

DOCUMENTATION

GET
Retrieves an training module comments.
Level 5 is required

--
Example Request:

{
   "method":"GET",
   "module":"training.comments",
   "request":{
      "module_id":"2066",
      "type": 1
   }
}

Example Response:

{
   "status":1,
   "data":[
      {
         "id":"199",
         "store":"131",
         "user":"27",
         "type":"1",
         "text":"test2",
         "file":"",
         "status":"0",
         "module":"2066",
         "created":"1343333886",
         "updated":"0",
         "ip_address":"",
         "name":"Alan Ford",
         "avatar":"1330825543"
      },
      {
         "id":"203",
         "store":"131",
         "user":"27",
         "type":"1",
         "text":"new comment",
         "file":"",
         "status":"0",
         "module":"2066",
         "created":"1344192241",
         "updated":"0",
         "ip_address":"",
         "name":"Alan Ford",
         "avatar":"1343333886"
      },
      {
         "id":"204",
         "store":"131",
         "user":"6207",
         "type":"1",
         "text":"Alija`s comment",
         "file":"",
         "status":"0",
         "module":"2066",
         "created":"1344192653",
         "updated":"0",
         "ip_address":"",
         "name":"Alija Sirotanovic",
         "avatar":"1343306419"
      }
   ],
   "token":"xxxxxxx"
}

UPDATE
Adds comments or homework on training modules. If we do not specify comment id, new comment/homework is added. If we do specify comment/homework id, we update existing comment/homework.
Level 5 is required

--

Example Request:

{
   "method":"UPDATE",
   "module":"training.comments",
   "request":{
      "module_id":"2069",
      "type":2,
      "text":"New text"
   }
}

Example Response:

{
   "status":1,
   "data":true,
   "token":"xxxxxxx"
}