Discussion Service
Create message
Creates a reply to the discussion with the given id.
POST http://domain:port/application_context/api/core/v2/discussions/{id}/messages
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the discussion being replied to | |
Form Parameters
Name | Type | Description | Default Value |
---|
subject | String | the subject of the reply | |
html | DocumentParam | the html body of the reply | |
attachmentURIs | Set | any URIs for the attachments which are to be attached to the discussion | |
Response
Type | Description |
---|
Response | a HTTP 201 response including the URL for the created reply in the Location header |
Delete discussion
Deletes the discussion with the given id. This end point requires that the authenticated user be authorized to
delete the discussion and that the discussion exist in order for this operation to complete successfully. If
either of these two conditions is not met an error will occur.
DELETE http://domain:port/application_context/api/core/v2/discussions/{id}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the discussion which will be deleted. | |
Delete track
DELETE http://domain:port/application_context/api/core/v2/discussions/{id}/tracks/{userId}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | | |
userId | long | | |
Follow
Start following the specified discussion.
POST http://domain:port/application_context/api/core/v2/discussions/{id}/followers
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the identifier of the discussion to follow. | |
Response
Type | Description |
---|
Response | a HTTP 201 response including the URL for the subscription in the Location header |
Get discussion
Returns the discussion with the given identifier. A discussion begins with a message and can contain a series of
replies. The initial message is returned inside the body of the discussion and any reply messages can be
returned by querying "/messages".
GET http://domain:port/application_context/api/core/v2/discussions/{id}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the identifier for the discussion which is to be returned. | |
Response
Type | Description |
---|
Discussion | the discussion with the given identifier. |
Example
JSON Response Payload
{
"message" : {
"content" : {
"type" : "text",
"body" : "xv72gxa2QO3ezBuKyMyuNP9MWdVsRHlbiFw3CLbddQypMqELpZIUSmbpX70uEFv8Uyt81oTFQExcRi33pW4COZMzQVyrgyKCV0KK7XkiPqZUEmkpFaw9UTln18tlDJqjli0adSNyHLxz7tl9lv45q3Ewp7qysUdOioty13PmN2Chrp5FY9gWmcXBfOUYzmV0rK4qrN9Q6gK1VuR6fKZGSgCTVtwmjyJxCjdVxl2MULbBFFv8gvNlTg1tEJP4IBv"
},
"status" : "published",
"subject" : "o8sUJZMwDVv4oFu5zR39",
"likes" : 0,
"id" : 1000,
"type" : 2,
"creationDate" : "2010-08-10T17:22:19.479+0000",
"modificationDate" : "2010-08-10T17:22:19.479+0000",
"links" : {
"alt" : "http://localhost:50001/oc/v1/messages/1000"
}
},
"replyCount" : 0,
"status" : "published",
"subject" : "o8sUJZMwDVv4oFu5zR39",
"author" : {
"name" : "user-513q1bxPgWYmBXhe",
"username" : "user-513q1bxpgwymbxhe",
"id" : 2000,
"type" : 3,
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/2000",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"likes" : 0,
"id" : 1000,
"type" : 1,
"creationDate" : "2010-08-10T17:22:19.479+0000",
"modificationDate" : "2010-08-10T17:22:19.479+0000",
"links" : {
"container" : "http://localhost:50001/oc/v1/spaces/2003",
"messages" : "http://localhost:50001/oc/v1/discussions/1000/messages"
}
}
Get follower
Check if the user is following the specified discussion.
GET http://domain:port/application_context/api/core/v2/discussions/{id}/followers/{userId}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the identifier of the discussion to check for followers. | |
userId | long | the id of the follower to check for | |
Response
Type | Description |
---|
UserSummary | the user summary for the user if the user is following and a HTTP 404 response if the user is not following |
Get messages
Returns the latest messages for a given content object. When excludeReplies is set to true the messages returned
will be sorted by date from oldest to newest, otherwise the messages will be returned based on a pre-order, oldest
first traversal of the message tree, e.g. the following message tree:
1
|-- 3
|-- |-- 4
|-- |-- |-- 7
|-- |-- |-- |-- 10
|-- |-- 6
|-- |-- 8
|-- 5
will result in messages ordered 1 3 4 7 10 6 8 5.
GET http://domain:port/application_context/api/core/v2/discussions/{id}/messages?offset=int&limit=int&excludeReplies=boolean&sort=String&anchor=String
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the identifier of the discussion for which the messages are going to be returned. | |
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 most messages which will be returned from this call. If there are fewer messages available
in the given time period, if either before or after is provided, then fewer messages will be returned then the
limit. | "25" |
excludeReplies | boolean | whether to only include top-level messages or not | "false" |
sort | String | the order in which the messages should be returned. Possible values are threaded and chronological. Defaults to chronological. | "chronological" |
anchor | String | optional URI for a message to anchor at. Specifying a anchor will try to return the page containing the anchor.
If the anchor could not be found then the first page of messages will be returned. | |
Response
Type | Description |
---|
EntityCollection | a collection of messages in the requested discussion. |
Example
JSON Response Payload
{
"data" : [ {
"content" : {
"type" : "html",
"body" : "<body><!-- [DocumentBodyStart:1636d7c4-5868-4495-86d1-bc2191aa005a] --><div class=\"jive-rendered-content\"><p>zBwcsnU6zSzEFUNCencTNGTgUYamsaoVh3yWHU9IEPBmhvQkDcpkNXas2zqfQxx8NuKInqZmIBJvqWiMR1Lid9gokFXupW4s5PKO2QVAZ22oyft3zmO9jSEtMPVGEPo1mn95LCMS5663ImRsi94x9TpKBmlvQAJpsaNkviBqPYJeIzAEpCrliQcBGq6CQeWegww3QaHvb5C5xqmnPV8mMVReNYv69ku65JKDT05vLdG1l6TzdOtYNyx2rBDufsnH33C44IX98OLSpUHDuqqOXxfPP6itm2VC5hAKS3IMbytQBUZl8jciHz5IM3Zq4mpGJz25cKCuBTuXwYzAWfQ0MkiZB0bPT6owFPUgxEp55dmyOl2btAY10tPpEi7jVcE3ik6JJNWq0P18ZUZFyKckKGQlY4poQiF2QXyElvmEg7G8V1woTOn9tykeQHiaX85wPhGnV1oWc3yHirlAgLN2LPZba9nDWmnh8Jh3oYybl6vWlpWMOBG9</p></div><!-- [DocumentBodyEnd:1636d7c4-5868-4495-86d1-bc2191aa005a] --></body>"
},
"status" : "published",
"author" : {
"name" : "user-4xlM3DtgCF9BLPEt",
"username" : "user-4xlm3dtgcf9blpet",
"id" : 2005,
"type" : 3,
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/2005",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"likes" : 0,
"id" : 1005,
"type" : 2,
"creationDate" : "2010-08-10T20:25:29.273+0000",
"modificationDate" : "2010-08-10T20:25:29.273+0000",
"links" : {
"alt" : "http://localhost:50001/oc/v1/messages/1005",
"parent" : "http://localhost:50001/oc/v1/messages/1000"
}
}, {
"content" : {
"type" : "html",
"body" : "<body><!-- [DocumentBodyStart:6276737f-dcf8-4728-9eb7-07423d5db412] --><div class=\"jive-rendered-content\"><p>ee8DFUT13bDVcboV8eQVXvjP1yMiGkX9W9GqnKHEcx85S84ZE2cgYKdVT9q2wASzmRM2G3oKhwSMdIauZGL29md675BLR5gKHE6l7svVy6VZpaGsoBu59NZMvtAONnAR7Un40gt2rFrIy43xI9vlPsgwl68QzrC2tyemAWP6FSgZ2hGYxS3Ba3PIaVEw5MvmjfzFG5XK6dEg9RGgjq7Mg6SwF5mZOHLgQVQE4ISmvnBPTY2u8pRys27SxAtUh4G79VQCH4Ahp5TDVyVjHQ3jbUsU9DeHv5Ds8EL9Anq18loZerP8jgP8fQi3SkdIDWBHV8RKiCAGAhmvOxHJtCfxOfIvPIvfGFwILIy7rKHoypc8AcVhzM1WtGNosayDHItHOdI3CGVlrmqZ2xNbJdOATOfDwPjvqHC1wqX7E6EnTjaVZYcJwgwS3R97R92bpRuKIHQQxnkdHxq0VUZIh82blBAuHjkyrhiUYRhM2QsS6fAyLEWXCBQz</p></div><!-- [DocumentBodyEnd:6276737f-dcf8-4728-9eb7-07423d5db412] --></body>"
},
"status" : "published",
"author" : {
"name" : "user-2YE1YW2MAX3q45T9",
"username" : "user-2ye1yw2max3q45t9",
"id" : 2004,
"type" : 3,
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/2004",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"likes" : 0,
"id" : 1004,
"type" : 2,
"creationDate" : "2010-08-10T20:25:29.257+0000",
"modificationDate" : "2010-08-10T20:25:29.257+0000",
"links" : {
"alt" : "http://localhost:50001/oc/v1/messages/1004",
"parent" : "http://localhost:50001/oc/v1/messages/1000"
}
}, {
"content" : {
"type" : "html",
"body" : "<body><!-- [DocumentBodyStart:90f0ffdd-da28-41d4-bace-c0bbaf7b996c] --><div class=\"jive-rendered-content\"><p>GIt2PTBWysMaP9RtGVwlYx3cijfWBoEGQR5ODtNEzIJVSnMGodcojVuQrvnT1NHvJX006KJMntJr9QKhXtZcN3QV4i3YTNrcWqyyskX1Brw5awhoQk8p1TCSZBlNFCzzAR19Tph5ADOSWwRd1NiwHk8YoOp21JIqiZmnhHSb5E327r7k6MXAMcGYxiN8qklrtOA2QTlT8uY1x7GTpDdd3IKclW2UFExs0F6LBdV90q1iwYNxOiqtUvhIbIfcj07SYxPyaBqGJ1zUoLimQoyWJbfspaNIayUWoNTCYCVPKYIctHcBKhXEartSzRnXLY9k8LiMRHheaJ1Gi59tvL5dts9hLdQsqJqVwUAnhEiFOSqumsiMuuhoUvpVbP92IEhPsaH0dMeWlp0nbUcieudb4rs1k4EEsGeRfKxlIVlsZvsBgy3C0SGtkZoMdDdMnvTNesvjSP9dBUK0eGsd2ZfWLFOVOYl4nZ7DVwuXKfYG68sGSc55GLkN</p></div><!-- [DocumentBodyEnd:90f0ffdd-da28-41d4-bace-c0bbaf7b996c] --></body>"
},
"status" : "published",
"author" : {
"name" : "user-lAKz9R823v1hUC1i",
"username" : "user-lakz9r823v1huc1i",
"id" : 2003,
"type" : 3,
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/2003",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"likes" : 0,
"id" : 1003,
"type" : 2,
"creationDate" : "2010-08-10T20:25:29.239+0000",
"modificationDate" : "2010-08-10T20:25:29.239+0000",
"links" : {
"alt" : "http://localhost:50001/oc/v1/messages/1003",
"parent" : "http://localhost:50001/oc/v1/messages/1000"
}
}, {
"content" : {
"type" : "html",
"body" : "<body><!-- [DocumentBodyStart:af825ed7-1534-43b0-a6c2-09c15a78e06d] --><div class=\"jive-rendered-content\"><p>cZI7DsH3HmgvrM6D3Csom9CyiAof4MAd2EMzmnFI0InzOC0vSDbEXQiN0ek7AJZCp3gaoymu2DSzhMAgCmf1MiGwSyvbgcZEDoZ8zbUGSYP5FYCxGeV6L5KP8lbVOhiQ0kXjTvWJa0qd2G58BpnhVfvHpPKVAEmjQdDItKGGQ0m7TaJEfAFzUVYu3FSRYkR2rpGr21kuCKsBRWTfWQ4WMNO5HzIorlqrfJ4iXGfWNnICSTZ5nH7ifOJkCVJBlnDWCny08A38Yb06xFGgCfLzqbcbfpTCtMVKkuRbbJRVP8SCzghfU76TBerEeMopUN62kPZkitzhyd2CTrJ2SdfSDpRxU5oUN1EFEnqTEk02ojEQIErbDpHKR3NcWy3yDCQBPyrqBCmNgvlxTi6sjTiDHY0gXX7k97DXVIDbvs3aGueZlzEwpH1q4slGJi8i42hIi8V0Xs12QO4vfL7ZRbwVmY1HQZXdCgvVoBkkvshSGx6nEsue3Ngp</p></div><!-- [DocumentBodyEnd:af825ed7-1534-43b0-a6c2-09c15a78e06d] --></body>"
},
"status" : "published",
"author" : {
"name" : "user-nTP3a9DvJq4Oym63",
"username" : "user-ntp3a9dvjq4oym63",
"id" : 2002,
"type" : 3,
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/2002",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"likes" : 0,
"id" : 1002,
"type" : 2,
"creationDate" : "2010-08-10T20:25:29.222+0000",
"modificationDate" : "2010-08-10T20:25:29.222+0000",
"links" : {
"alt" : "http://localhost:50001/oc/v1/messages/1002",
"parent" : "http://localhost:50001/oc/v1/messages/1000"
}
}, {
"content" : {
"type" : "html",
"body" : "<body><!-- [DocumentBodyStart:37384f24-5d79-47c1-9df4-c140795d5d18] --><div class=\"jive-rendered-content\"><p>vaTFDVmv0CgKiMdAb9NhTfkEyZkWIGyZgQWxNoyc4K6tjckm9LEiK1nYgpVKowfuk2sCJNHem5SHFv0jjBbeJ4VqsNU1QbJ9GSkF4FY2pM8pq6iWiB9RXMgRA6vnljKGYImWlvJgGu189iiggH0kLyllG1UdiOCtrDV2oAyl2mQk7fQbud3HOLQQRWhocexlPh13o2dg13ZaA8BOkHC2yISl38q3bq8vAuYLzPC6XG8kMMQuP3iA102McvMj9cDwNT9ysuPK4Qwg7TjXJWuqrZym8u6ag1zoAGZia286Vo24FeuQ4CQFHEziSminxISPsr8vLvAIuFhxcaIPV2rB2z9NU6ti7rCovhpl1yiPeqXTyqjZAYGVaSwT9aVlNHss2SDbDyAXaJbz9R0xQRYu00iDs9E4uksxTUI5ZiCL4NUereS0DFH8L30JpApbXcOFcdWz3r4VLcC4JOZJ8mcRAgcz4lj9PPqKDDYo1ePwfuE7qx2Dwlta</p></div><!-- [DocumentBodyEnd:37384f24-5d79-47c1-9df4-c140795d5d18] --></body>"
},
"status" : "published",
"author" : {
"name" : "user-dHbbM0a6Tf4dn35W",
"username" : "user-dhbbm0a6tf4dn35w",
"id" : 2001,
"type" : 3,
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/2001",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"likes" : 0,
"id" : 1001,
"type" : 2,
"creationDate" : "2010-08-10T20:25:29.205+0000",
"modificationDate" : "2010-08-10T20:25:29.205+0000",
"links" : {
"alt" : "http://localhost:50001/oc/v1/messages/1001",
"parent" : "http://localhost:50001/oc/v1/messages/1000"
}
} ],
"links" : {
"next" : "http://localhost:50001/oc/v1/discussions/1000/messages?limit=5&before=2010-08-10T20%253A25%253A29.205%252B0000",
"previous" : "http://localhost:50001/oc/v1/discussions/1000/messages?limit=5&after=2010-08-10T20%253A25%253A29.273%252B0000"
}
}
Get track
GET http://domain:port/application_context/api/core/v2/discussions/{id}/tracks/{userId}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | | |
userId | long | | |
Read
POST http://domain:port/application_context/api/core/v2/discussions/{id}/read
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | | |
Share
POST http://domain:port/application_context/api/core/v2/discussions/{id}/share
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | | |
Track
POST http://domain:port/application_context/api/core/v2/discussions/{id}/tracks
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | | |
Unfollow
Stop following the specified discussion
DELETE http://domain:port/application_context/api/core/v2/discussions/{id}/followers/{userId}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the identifier of the discussion to stop following | |
userId | long | the id of the following user to be removed. | |
Unread
DELETE http://domain:port/application_context/api/core/v2/discussions/{id}/read
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | | |