• Document Up to Date

Search Comments

Returns all comments that match the search parameter.

Resource Information

This service uses the tomcat application on port 8080 by default. To see a list of default ports click here

The context for this API is /crafter-social, please prefix the API URLs with this context.

HTTP Verb
POST
URL
/api/3/comments/search
Response Formats
JSON

Parameters

Name
Type
Required
Description
context
String
The ID of the Social Context
search
String
MongoDB query (except $where)
sortBy
String
MongoDB sort string
start
Integer
Starting position for pagination
limit
Integer
Final positiion for pagination

Example

Request

POST .../api/3/comments/search
context=f5b143c2-f1c0-4a10-b56e-f485f00d3fe9
search={ targetId: "Welcome" }
sortBy={ lastModifiedDate: 1 }
start=0
limit=5

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-13T09:30Z",
11    "anonymousFlag": false,
12    "attributes": {},
13    "children": [],
14    "attachments": [],
15    "moderationStatus": "UNMODERATED",
16    "votesUp": [],
17    "votesDown": [],
18    "flags": [],
19    "_id": "59678d3f300426156e21df50"
20  }
21]

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" }