Moduł odpowiedzialny za zarządzanie komentarzami - listowanie, tworzenie, modyfikacja, usuwanie.
Endpointy obsługujące żądanie:
https://api.5ways.comGET /rest/comment
Zwraca listę komentarzy
HTTP/1.1 200 OK
{
"Comment": {
"id": "1",
"group_id": "1",
"user_id": "1",
"body": "treść komentarza",
"created": "2018-05-17 11:31:32",
"modified": "2018-05-18 08:09:13"
}
},
{
"Comment": {
"id": "2",
"group_id": "1",
"user_id": "1",
"body": "treść komentarza 2",
"created": "2018-05-17 11:31:32",
"modified": "2018-05-18 08:09:13"
}
}
GET /rest/comment/{id}
Zwraca komentarz
HTTP/1.1 200 OK
{
"Comment": {
"id": "1",
"group_id": "1",
"user_id": "1",
"body": "treść komentarza",
"created": "2018-05-17 11:31:32",
"modified": "2018-05-18 08:09:13"
}
}
POST /rest/comment
Tworzy nowy komentarz
{
"Comment": {
"group_id": "1",
"user_id": "1",
"body": "treść komentarza numer trzy"
}
}
Zwraca obiekt z id nowo utworzonego komentarza
HTTP/1.1 201 Created
location: https://api.5ways.com/rest/comment/{id}
{
"id": 115
}
PUT /rest/comment/{id}
Modyfikuje dane komentarza
{
"Comment": {
"body": "treść komentarza po zmianach"
}
}
HTTP/1.1 200 OK
{
"status": "OK"
}
DELETE /rest/comment/{id}
Trwale usuwa komentarz
HTTP/1.1 200 OK
{
"status": "OK"
}