Update Service
Resource | Description |
---|
Attach image | Attaches a image to the given status update. |
Create comment | Posts a new comment on the specified content object. |
Delete like | Deletes the user's like of the specified content object |
Delete track | |
Delete update | Deletes the status update with the given id |
Follow | Start following the specified comment content object. |
Get comments | Returns the latest comments for a given content object. |
Get follower | Check if the user is following the specified comment content object |
Get images | Gets all images attached to the given status update |
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 track | |
Get update | Returns the status update with the given identifier. |
Get updates | Returns the latest updates in the system sorted by the date they were created. |
Like | Adds a like to the specified content object |
Read | |
Repost update | Reposts an update. |
Share | |
Track | |
Unfollow | Stop following the specified comment content object |
Unread | |
Update update | Updates the given microblog entry |
Attach image
Attaches a image to the given status update. Images may only be attached while the update is in DRAFT status.
POST http://domain:port/application_context/api/core/v2/updates/{id}/images
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the update | |
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 |
Posts a new comment on the specified content object.
POST http://domain:port/application_context/api/core/v2/updates/{id}/comments
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the content object | |
Form Parameters
Name | Type | Description | Default Value |
---|
html | DocumentParam | the HTML body of comment | |
Response
Type | Description |
---|
Response | a HTTP 201 response including the URL for the created comment in the Location header |
Example
Form Payload
html=%3Cdiv+class%3D%22jive-rendered-content%22%3EFoobar%3C%2Fdiv%3E
Delete like
Deletes the user's like of the specified content object
DELETE http://domain:port/application_context/api/core/v2/updates/{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 | |
Delete track
DELETE http://domain:port/application_context/api/core/v2/updates/{id}/tracks/{userId}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | | |
userId | long | | |
Delete update
Deletes the status update with the given id
DELETE http://domain:port/application_context/api/core/v2/updates/{id}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the update | |
Follow
Start following the specified comment content object.
POST http://domain:port/application_context/api/core/v2/updates/{id}/followers
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the identifier of the comment content object to follow. | |
Response
Type | Description |
---|
Response | a HTTP 201 response including the URL for the subscription in the Location header |
Returns the latest comments for a given content object. When excludeReplies is set to true the comments returned
will be sorted by date from oldest to newest, otherwise the comments will be returned based on a pre-order, oldest
first traversal of the comment tree, e.g. the following comment tree:
1
|-- 3
|-- |-- 4
|-- |-- |-- 7
|-- |-- |-- |-- 10
|-- |-- 6
|-- |-- 8
|-- 5
will result in comments ordered 1 3 4 7 10 6 8 5.
GET http://domain:port/application_context/api/core/v2/updates/{id}/comments?offset=int&limit=int&excludeReplies=boolean&sort=String&anchor=String
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the content object | |
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" |
excludeReplies | boolean | whether to only include top-level comments or not | "false" |
sort | String | the order in which the comments should be returned. Possible values are threaded and chronological. Defaults to chronological. | "chronological" |
anchor | String | optional URI for a comment 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 comments will be returned. | |
Example
JSON Response Payload (No Pagination)
TBD
JSON Response (Pagination)
TBD
Get follower
Check if the user is following the specified comment content object
GET http://domain:port/application_context/api/core/v2/updates/{id}/followers/{userId}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the identifier of the comment content object 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 images
Gets all images attached to the given status update
GET http://domain:port/application_context/api/core/v2/updates/{id}/images
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the update | |
Response
Type | Description |
---|
List of ImageEntity | a collection of images attached to the status update |
Example
JSON Response Payload
[ {
"size" : 16470,
"ref" : "http://localhost:50001/oc/v1/images/1004",
"contentType" : "image/png"
}, {
"size" : 602438,
"ref" : "http://localhost:50001/oc/v1/images/1006",
"contentType" : "image/png"
} ]
Get like
Indicates whether the user likes the specified content object.
GET http://domain:port/application_context/api/core/v2/updates/{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 |
Get likes
Gets a list of all users that like the specified content object
GET http://domain:port/application_context/api/core/v2/updates/{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
Get track
GET http://domain:port/application_context/api/core/v2/updates/{id}/tracks/{userId}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | | |
userId | long | | |
Get update
Returns the status update with the given identifier. Each update in the system has a unique identifier which can
be provided in order to retrieve it. Updates can only be retrieved by non-authors after they have been published,
attempts to do so before they were published will result in a
FORBIDDEN response from the server.
GET http://domain:port/application_context/api/core/v2/updates/{id}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the update | |
Response
Type | Description |
---|
Update | the status update with the given identifier. |
Example
JSON Response Payload:
{
"longitude" : -122.6805419921875,
"latitude" : 45.52191162109375,
"content" : {
"type" : "text/html",
"text" : "<body><!-- [DocumentBodyStart:d5425719-a5a3-401d-88ce-d3e5c3c219f5] --><div class=\"jive-rendered-content\"><span>6Z0f0KwPO7HHaBW4rY6ODKKZY</span></div><!-- [DocumentBodyEnd:d5425719-a5a3-401d-88ce-d3e5c3c219f5] --></body>"
},
"status" : "published",
"author" : {
"name" : "user-a08b8aP2P7vKCftC",
"username" : "user-a08b8ap2p7vkcftc",
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/2000",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"replyCount" : 0,
"likeCount" : 0,
"creationDate" : "2010-08-31T18:43:32.671+0000",
"modificationDate" : "2010-08-31T18:43:32.671+0000",
"viewCount" : 0,
"links" : {
"follow" : "http://localhost:50001/oc/v1/updates/1000/followers"
}
}
Get updates
Returns the latest updates in the system sorted by the date they were created. Both an offset and a limit can be
provided in order to be able to iterate through all updates in the system.
GET http://domain:port/application_context/api/core/v2/updates?offset=int&limit=int
Query Parameters
Name | Type | Description | Default Value |
---|
offset | int | the number of updates which should be skipped in the returned array. For instance, if the first 25
udpates have already been retrieved updates after the 25th update 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 limit is the maximum number of updates which should be returned in the array. Depending upon
how the update are being presented on the client should define how many groups are needing to be returned. If the
the total number of updates available in the system is less than the offset or if, in combination with the offset,
the number of updates cannot be returned than the number of groups returned will be less than the given number.
The minimum number is 1 and the maximum number is 1000, any limits provided outside of this range will result in
an exception | "25" |
Response
Type | Description |
---|
EntityCollection | the latest updates in the system sorted by the date they were created. |
Example
JSON Response Payload (No Pagination)
{"data" : [ {
"longitude" : -122.6805419921875,
"latitude" : 45.52191162109375,
"status" : "published",
"creationDate" : 1280249782276,
"modificationDate" : 1280249782276,
"containerID" : null,
"containerType" : null,
"subject" : null,
"text" : null,
"author" : {
"username" : "user-aonio0vo7zfmvlfb",
"type" : 3,
"id" : 2003,
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/2010",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"html" : "<body><!-- [DocumentBodyStart:f6f8ffca-6c96-49c3-a7f0-384be0ba53f8] --><div class=\"jive-rendered-content\"><span>UJraBCXbxc8IzfLVoH7ReluhX</span></div><!-- [DocumentBodyEnd:f6f8ffca-6c96-49c3-a7f0-384be0ba53f8] --></body>",
"type" : 1464927464,
"id" : 1003
}]
}
Like
Adds a like to the specified content object
POST http://domain:port/application_context/api/core/v2/updates/{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. |
Read
POST http://domain:port/application_context/api/core/v2/updates/{id}/read
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | | |
Repost update
Reposts an update. Reposting an update is referencing an update as part of an update that is created on behalf
of the authenticated user. Commentary can be added by providing the html parameter but it is not required when
reposting.
POST http://domain:port/application_context/api/core/v2/updates/{id}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the id of the update which is being reposted. | |
Form Parameters
Name | Type | Description | Default Value |
---|
html | String | any content to put in the update which will contain the reposted update. | |
latitude | Double | the latitude of the user posting the update | |
longitude | Double | the longitude of the user posting the update | |
draft | boolean | flag indicating whether to create the update in draft or published state | "false" |
Response
Type | Description |
---|
Response | a HTTP 201 response including the URL for the new status update in the Location header |
Example
Form Parameter Payload
draft=true&longitude=-122.159544&html=<body>Foobar</body>&latitude=37.442708
Share
POST http://domain:port/application_context/api/core/v2/updates/{id}/share
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | | |
Track
POST http://domain:port/application_context/api/core/v2/updates/{id}/tracks
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | | |
Unfollow
Stop following the specified comment content object
DELETE http://domain:port/application_context/api/core/v2/updates/{id}/followers/{userId}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the identifier of the comment content object. | |
userId | long | the id of the following user to be removed. | |
Unread
DELETE http://domain:port/application_context/api/core/v2/updates/{id}/read
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | | |
Update update
Updates the given microblog entry
PUT http://domain:port/application_context/api/core/v2/updates/{id}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the system wide unique identifier for the update | |
Response
Type | Description |
---|
Update | the JSON representation of the status update |
Example
JSON Request Payload:
{
"longitude" : -122.159544,
"latitude" : 37.442708,
"content" : {
"type" : "html",
"body" : "<body>Foobar</body>"
},
"status" : "draft",
}
JSON Response Payload
{
"longitude" : -122.159544,
"latitude" : 37.442708,
"content" : {
"type" : "html",
"body" : "<body><!-- [DocumentBodyStart:7ed102a7-ae36-46a1-8d6b-1829e13c99d0] --><div class=\"jive-rendered-content\"><span>Foobar</span></div><!-- [DocumentBodyEnd:7ed102a7-ae36-46a1-8d6b-1829e13c99d0] --></body>"
},
"status" : "draft",
"id" : 1037,
"type" : 1464927464,
"creationDate" : "2010-08-03T19:55:58.354+0000",
"modificationDate" : "2010-08-03T19:55:58.354+0000"
}