RTyy / aiocomments

Comments Service Based on aiohttp
0 stars 0 forks source link

Make method to get the first level comments for the specified instance #10

Open RTyy opened 7 years ago

RTyy commented 7 years ago

Request:

  "itype_id": instance_type_id,  # id of the instance type (0 or unspecified = comment),
  "i_id": instance_id,  # id of the instance,
  "last_id": last_comment_id,  # id of the last (the eldest comment from the previous request),
  "limit": number_of_comments_on_page,  # number of comments should be returned
curl -i -X GET http://local.server.com/api/comments/list/{itype_id}/{i_id}/
curl -i -X GET http://local.server.com/api/comments/list/{itype_id}/{i_id}/{limit}/
curl -i -X GET http://local.server.com/api/comments/list/{itype_id}/{i_id}/{limit}/{last_id}/

Responses:

On Success Status Code: 200

{
  "comments": [
    {
      "id": comment_id,
      "user_id": author_id,
      "content": comment_content,
      "create_date": comment_create_date,
      "update_date": comment_update_date,
    },
    {
      ...
    }
  ]
}

On Error Status Code: 400, 403, 404

{
  "error": error_title,
  "data_errors": {
     "var_name": error_code,
     ...
  }
}
RTyy commented 7 years ago

1h