Resource | Description |
---|
Attach image | Attaches a image to the given comment. |
Create comment | Creates a reply to the comment with the given id. |
Delete comment | Deletes the comment with the given id. |
Delete like | Deletes the user's like of the specified content object |
Get comment | Retrieves the comment with the given id |
Get images | Gets all images attached to the given comment |
Get like | Indicates whether the user likes the specified content object. |
Get likes | Gets a list of all users that like the specified content object |
Get replies | Returns the latest replies to the given comment sorted by the date they were created (oldest first). |
Like | Adds a like to the specified content object |
Update comment | Updates the comment with the given id. |
Attaches a image to the given comment.
POST http://domain:port/application_context/api/core/v2/comments/{id}/images
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the comment | |
Post Payload
Name | Type | Description | Default Value |
---|
body | MultipartBody | the multi-part body that contains the image binary | |
Response
Type | Description |
---|
Response | a HTTP 201 response including the URL for the uploaded image in the Location header |
Creates a reply to the comment with the given id.
POST http://domain:port/application_context/api/core/v2/comments/{id}/replies
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the comment being replied to | |
Form Parameters
Name | Type | Description | Default Value |
---|
html | DocumentParam | the html body of the reply | |
Response
Type | Description |
---|
Response | a HTTP 201 response including the URL for the created reply in the Location header |
Example
Form Payload
html=%3Cdiv+class%3D%22jive-rendered-content%22%3EFoobar%3C%2Fdiv%3E
Deletes the comment with the given id.
DELETE http://domain:port/application_context/api/core/v2/comments/{id}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the comment to delete | |
Deletes the user's like of the specified content object
DELETE http://domain:port/application_context/api/core/v2/comments/{id}/likes/{userID}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the content object | |
userID | long | the system wide unique identifier for the user | |
Retrieves the comment with the given id
GET http://domain:port/application_context/api/core/v2/comments/{id}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the comment | |
Response
Type | Description |
---|
Comment | the JSON representation of the comment |
Example
JSON Response Payload
{
"replyCount" : 0,
"content" : {
"type" : "html",
"body" : "<body><!-- [DocumentBodyStart:b88200a7-1099-4389-b6ea-c93e40858f99] --><div class=\"jive-rendered-content\"><p>This is a test comment</p></div><!-- [DocumentBodyEnd:b88200a7-1099-4389-b6ea-c93e40858f99] --></body>"
},
"status" : "published",
"author" : {
"username" : "user-c32deto2nt5lw5ie",
"id" : 2000,
"type" : 3,
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/2000",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"id" : 1000,
"type" : 105,
"creationDate" : "2010-08-03T16:11:27.597+0000",
"modificationDate" : "2010-08-03T16:11:27.597+0000",
"links" : {
"content" : "http://localhost:50001/oc/v1/updates/1000",
"children" : "http://localhost:50001/oc/v1/comments/1000/replies"
}
}
Gets all images attached to the given comment
GET http://domain:port/application_context/api/core/v2/comments/{id}/images
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the comment | |
Response
Type | Description |
---|
List of ImageEntity | a collection of images attached to the comment |
Example
JSON Response Payload
[ {
"size" : 16470,
"ref" : "http://localhost:50001/oc/v1/images/1004",
"contentType" : "image/png",
"id" : 1004,
"type" : 111
}, {
"size" : 602438,
"ref" : "http://localhost:50001/oc/v1/images/1006",
"contentType" : "image/png",
"id" : 1006,
"type" : 111
} ]
Indicates whether the user likes the specified content object.
GET http://domain:port/application_context/api/core/v2/comments/{id}/likes/{userID}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the content object | |
userID | long | the system wide unique identifier for the user | |
Response
Type | Description |
---|
UserSummary | the user summary if the specified user likes the content object or a HTTP 404 if the user
does not like the content object |
Gets a list of all users that like the specified content object
GET http://domain:port/application_context/api/core/v2/comments/{id}/likes
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the content object | |
Response
Type | Description |
---|
EntityCollection | a collection of user summaries for the users that like the content object |
Example
JSON Response Payload
TBD
Returns the latest replies to the given comment sorted by the date they were created (oldest first). Note that this
method only returns direct replies, i.e. replies to replies and so on are not returned.
GET http://domain:port/application_context/api/core/v2/comments/{id}/replies?offset=int&limit=int
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the parent comment | |
Query Parameters
Name | Type | Description | Default Value |
---|
offset | int | the number of results which should be skipped in the returned collection. For instance,
if the first 25 results have already been retrieved then results after the 25th result can be retrieved by
specifying an offset of 25. The minimum value for the offset is 0, specifying anything less than 0 for the offset
will result in an exception. | "0" |
limit | int | the maximum number of comments to return. If there are fewer comments available
in the given time period, if either after or before is provided, then fewer comments will be returned then the
limit. | "25" |
Response
Type | Description |
---|
EntityCollection | a collection of replies to the comment ordered by the date they were created (oldest to newest). |
Example
JSON Response Payload (No Pagination)
{
"data" : [ {
"replyCount" : 0,
"content" : {
"type" : "html",
"body" : "<body><!-- [DocumentBodyStart:92b15e08-2417-43ce-a4ff-a562cf1789c5] --><div class=\"jive-rendered-content\"><p>This is another child comment</p></div><!-- [DocumentBodyEnd:92b15e08-2417-43ce-a4ff-a562cf1789c5] --></body>"
},
"status" : "published",
"author" : {
"username" : "user-e0o85wkluj1addeh",
"id" : 2008,
"type" : 3,
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/2008",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"id" : 1007,
"type" : 105,
"creationDate" : "2010-08-03T16:11:28.911+0000",
"modificationDate" : "2010-08-03T16:11:28.911+0000",
"links" : {
"content" : "http://localhost:50001/oc/v1/updates/1004",
"children" : "http://localhost:50001/oc/v1/comments/1007/replies",
"parent" : "http://localhost:50001/oc/v1/comments/1005"
}
}, {
"replyCount" : 0,
"content" : {
"type" : "html",
"body" : "<body><!-- [DocumentBodyStart:fc7ca51a-c9ed-44e5-916d-5663c326c3c5] --><div class=\"jive-rendered-content\"><p>This is a child comment</p></div><!-- [DocumentBodyEnd:fc7ca51a-c9ed-44e5-916d-5663c326c3c5] --></body>"
},
"status" : "published",
"author" : {
"username" : "user-e0o85wkluj1addeh",
"id" : 2008,
"type" : 3,
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/2008",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"id" : 1006,
"type" : 105,
"creationDate" : "2010-08-03T16:11:28.900+0000",
"modificationDate" : "2010-08-03T16:11:28.900+0000",
"links" : {
"content" : "http://localhost:50001/oc/v1/updates/1004",
"children" : "http://localhost:50001/oc/v1/comments/1006/replies",
"parent" : "http://localhost:50001/oc/v1/comments/1005"
}
} ]
}
JSON Response (Pagination)
"data" : [ {
"replyCount" : 0,
"content" : {
"type" : "html",
"body" : "<body><!-- [DocumentBodyStart:16669681-7fe2-4beb-8331-ec43a5f2883f] --><div class=\"jive-rendered-content\"><p>This is child comment #54</p></div><!-- [DocumentBodyEnd:16669681-7fe2-4beb-8331-ec43a5f2883f] --></body>"
},
"status" : "published",
"author" : {
"username" : "user-rvcixvvtkcpurhwh",
"id" : 2010,
"type" : 3,
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/2010",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"id" : 1064,
"type" : 105,
"creationDate" : "2010-08-03T16:11:30.387+0000",
"modificationDate" : "2010-08-03T16:11:30.387+0000",
"links" : {
"content" : "http://localhost:50001/oc/v1/updates/1006",
"children" : "http://localhost:50001/oc/v1/comments/1064/replies",
"parent" : "http://localhost:50001/oc/v1/comments/1009"
}
},{
"replyCount" : 0,
"content" : {
"type" : "html",
"body" : "<body><!-- [DocumentBodyStart:d6af1e85-638a-4156-ad97-00b1f0c7c0ac] --><div class=\"jive-rendered-content\"><p>This is child comment #35</p></div><!-- [DocumentBodyEnd:d6af1e85-638a-4156-ad97-00b1f0c7c0ac] --></body>"
},
"status" : "published",
"author" : {
"username" : "user-rvcixvvtkcpurhwh",
"id" : 2010,
"type" : 3,
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/2010",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"id" : 1045,
"type" : 105,
"creationDate" : "2010-08-03T16:11:29.989+0000",
"modificationDate" : "2010-08-03T16:11:29.989+0000",
"links" : {
"content" : "http://localhost:50001/oc/v1/updates/1006",
"children" : "http://localhost:50001/oc/v1/comments/1045/replies",
"parent" : "http://localhost:50001/oc/v1/comments/1009"
}
} ],
"links" : {
"next" : "http://localhost:50001/oc/v1/comments/1009/replies?limit=20&before=2010-08-03T16%253A11%253A29.989%252B0000",
"previous" : "http://localhost:50001/oc/v1/comments/1009/replies?limit=20&after=2010-08-03T16%253A11%253A30.387%252B0000"
}
}
Adds a like to the specified content object
POST http://domain:port/application_context/api/core/v2/comments/{id}/likes
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the content object | |
Response
Type | Description |
---|
Response | a HTTP 201 response including the URL for the "like" in the Location header. If this method
is called more than once for the same authenticated user then a HTTP 403 status will be returned. |
Updates the comment with the given id.
PUT http://domain:port/application_context/api/core/v2/comments/{id}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the comment being updated | |
Response
Type | Description |
---|
Comment | The JSON representation of the updates comment |
Example
JSON Request Payload
{"content":{"body":"<div class=\"jive-rendered-content\">Foobar<\/div>","type":"html"}}
JSON Response Payload
{
"replyCount" : 0,
"content" : {
"type" : "html",
"body" : "<body><!-- [DocumentBodyStart:2573d60a-3ae8-4ce9-a67e-16e770ecb0f9] --><div class=\"jive-rendered-content\"><div class=\"jive-rendered-content\">Foobar</div></div><!-- [DocumentBodyEnd:2573d60a-3ae8-4ce9-a67e-16e770ecb0f9] --></body>"
},
"status" : "published",
"author" : {
"username" : "user-8f0kvd9c9j632f85",
"id" : 2002,
"type" : 3,
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/2002",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"id" : 1001,
"type" : 105,
"creationDate" : "2010-08-03T16:11:28.136+0000",
"modificationDate" : "2010-08-03T16:11:28.136+0000",
"links" : {
"content" : "http://localhost:50001/oc/v1/updates/1001",
"children" : "http://localhost:50001/oc/v1/comments/1001/replies"
}
}