Get Comments By Moderation Status
Returns all the comments with a given moderation status.
Resource Information
This service uses the tomcat application on port 8080 by default.
The context for this API is /crafter-social
, please prefix the API URLs with this context.
HTTP Verb
|
GET
|
URL
|
/api/3/comments/moderation/:status |
Response Formats
|
JSON |
Parameters
Name
|
Type
|
Required
|
Description
|
---|---|---|---|
context
|
String
|
✓
|
The ID of the Social Context
|
status
|
String
|
✓
|
The moderation status to search
|
thread
|
String
|
The ID of the thread to search
|
|
pageNumber
|
Integer
|
Page number to return
|
|
pageSize
|
Integer
|
Comments per page
|
|
sortBy
|
List
|
List of fields to order by
|
|
sortOrder
|
List
|
List of sort orders for each field
|
Example
Request
GET .../api/3/comments/moderation/APPROVED?context=f5b143c2-f1c0-4a10-b56e-f485f00d3fe9&sortBy=lastModifiedDate&sortOrder=ASC
Response
Status 200 OK
1[
2 {
3 "ancestors": [],
4 "targetId": "Welcome",
5 "subject": "",
6 "body": "This was the first comment in the site!",
7 "createdBy": "59667e8abd4787992596ba6b",
8 "lastModifiedBy": "59667e8abd4787992596ba6b",
9 "createdDate": "2017-07-13T09:09Z",
10 "lastModifiedDate": "2017-07-13T14:44Z",
11 "anonymousFlag": false,
12 "attributes": {},
13 "children": [],
14 "attachments": [
15 {
16 "md5": "c86b6b1607621afff04b6a9b9048e87b",
17 "fileId": "5967c9dd300426156e21df53",
18 "contentType": "image/png",
19 "fileSize": "144.5 KB",
20 "storeName": "/f5b143c2-f1c0-4a10-b56e-f485f00d3fe9/59678d3f300426156e21df50/person1.png",
21 "fileName": "person1.png",
22 "savedDate": "2017-07-13T13:28Z",
23 "fileSizeBytes": 147970,
24 "attributes": {
25 "owner": "59678d3f300426156e21df50"
26 }
27 }
28 ],
29 "moderationStatus": "APPROVED",
30 "votesUp": [],
31 "votesDown": [],
32 "flags": [],
33 "_id": "59678d3f300426156e21df50"
34 }
35]
Responses
Status
|
Location
|
Response Body
|
---|---|---|
200
|
See example above.
|
|
401
|
{ "message" : "User must be logged in" } |
|
403
|
{ "message" : "Current subject does not have
permission to execute global action ..." }
|
|
500
|
{ "message" : "Internal server error" } |