• Document Up to Date

Update Comment Flags

Adds a flag to the given comment.

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/:id/flags
Response Formats
JSON

Parameters

Name
Type
Required
Description
context
String
The ID of the Social Context
id
String
The ID of the comment to update
reason
String
Reason why the comment is been flagged

Example

Request

POST .../api/3/comments/59678d3f300426156e21df50/flags?context=f5b143c2-f1c0-4a10-b56e-f485f00d3fe9
reason=Contains offensive language

Response

Status 200 OK

 1{
 2  "ancestors": [],
 3  "targetId": "Welcome",
 4  "subject": "",
 5  "body": "This was the first comment in the site!",
 6  "createdBy": "59667e8abd4787992596ba6b",
 7  "lastModifiedBy": "59667e8abd4787992596ba6b",
 8  "createdDate": "2017-07-13T09:09Z",
 9  "lastModifiedDate": "2017-07-13T15:17Z",
10  "anonymousFlag": false,
11  "attributes": {},
12  "attachments": [
13    {
14      "md5": "c86b6b1607621afff04b6a9b9048e87b",
15      "fileId": "5967c9dd300426156e21df53",
16      "contentType": "image/png",
17      "fileSize": "144.5 KB",
18      "storeName": "/f5b143c2-f1c0-4a10-b56e-f485f00d3fe9/59678d3f300426156e21df50/person1.png",
19      "fileName": "person1.png",
20      "savedDate": "2017-07-13T13:28Z",
21      "fileSizeBytes": 147970,
22      "attributes": {
23        "owner": "59678d3f300426156e21df50"
24      }
25    }
26  ],
27  "moderationStatus": "APPROVED",
28  "votesUp": [],
29  "votesDown": [],
30  "flags": [
31    {
32      "reason": "Contains offensive language",
33      "userId": "59667e8abd4787992596ba6b",
34      "_id": "5967e35f300426156e21df58"
35    }
36  ],
37  "_id": "59678d3f300426156e21df50"
38}

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