Space Service
Services for retrieving spaces in the system. The space tree can be traversed by utilizing
SpaceService.getSubSpaces(long, int, int)
and individual spaces can be retrieved by calling SpaceService.getSpace(long)
with
the desired space's ID.
Create binary document
Creates a new binary based document in the system. A document is a piece of content with multiple versions and can
be created in draft mode; though this endpoint does not expost that functionality. After a document is created it
can be retrieved in the listing of all documents in the container it was created in or it can be retrieved
directly by the URI provided in the response.
The subject of the document must be specified and the maximum length of the subject is limited
to 255 characters. Additionally, the subject of a document must be unique within the container it is created in
there is no means ahead of time to check if a document exists with the given subject but an error will result if
the created resource's subject will duplicate another document's title in the container.
POST http://domain:port/application_context/api/core/v2/spaces/{id}/binaryDocuments
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the id of the container in which the document will be created. | |
Post Payload
Name | Type | Description | Default Value |
---|
body | MultipartBody | the the multi-part body that contains the subject and binary body | |
Response
Type | Description |
---|
Response | a HTTP 201 response including the URL for the new document in the Location header. |
Create discussion
Creates a disucssion with the given subject and body. The container the discussion is created in is the container
pointed to with the given identifier. The discussion is created with the authenticated user as the author.
POST http://domain:port/application_context/api/core/v2/spaces/{id}/discussions
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the id of the container in which the discussion is being posted | |
Form Parameters
Name | Type | Description | Default Value |
---|
subject | String | the subject of the newly created discussion. | |
html | DocumentParam | the content of the newly created discussion. | |
question | Boolean | flag indicating whether the discussion is a question or not. May be omitted in which case the system default is used. | |
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 new discussion in the Location header |
Example
Form Parameter Payload
subject=Jru4ArAwnELsaBpcFRDP&html=ysyBVsUpc6cQl98FNsumyItYkp9Wom
Create document
Creates a new HTML based document in the system. A document is a piece of content with multiple versions and can
be created in draft mode; though this endpoint does not expost that functionality. After a document is created it
can be retrieved in the listing of all documents in the container it was created in or it can be retrieved
directly by the URI provided in the response.
POST http://domain:port/application_context/api/core/v2/spaces/{id}/documents
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the id of the container in which the document will be created. | |
Form Parameters
Name | Type | Description | Default Value |
---|
subject | String | the subject of the document. It must be specified and the maximum length of the subject is limited
to 255 characters. Additionally, the subject of a document must be unique within the container it is created in
there is no means ahead of time to check if a document exists with the given subject but an error will result if
the created resource's subject will duplicate another document's title in the container. | |
html | DocumentParam | HTML for the created document. | |
attachmentURIs | Set | any URIs for the attachments which are to be attached to the document. | |
Response
Type | Description |
---|
Response | a HTTP 201 response including the URL for the new document in the Location header. |
Follow
Start following the specified container.
POST http://domain:port/application_context/api/core/v2/spaces/{id}/followers
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the identifier of the container to follow. | |
Response
Type | Description |
---|
Response | a HTTP 201 response including the URL for the subscription in the Location header |
Get activities
GET http://domain:port/application_context/api/core/v2/spaces/{id}/activities?after=String&before=String&limit=int&type=Set
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | | |
Query Parameters
Name | Type | Description | Default Value |
---|
after | String | | "" |
before | String | | "" |
limit | int | | "25" |
type | Set | | |
Get content
Returns all content in the container. Only content types which are supported in the specified container are
returned.
GET http://domain:port/application_context/api/core/v2/spaces/{id}/content?offset=int&limit=int&q=String
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the unique identifier for the container which is being returned. | |
Query Parameters
Name | Type | Description | Default Value |
---|
offset | int | used while paginating through results to specify the number of results to skip before the first
retult in the returned result. | "0" |
limit | int | the maximum number of items to return. If there are fewer items available then limit then the lesser
number of items will be returned. The default value is 25 and the maximum is 1000. | "25" |
q | String | can be used to search across all content in the container with the given query string. | |
Get discussions
Returns a collection of discussions in a particular container. The discussions are sorted by their creation date
from newest to oldest and can be iterated through utilizing the date parameters since and until. Discussions
will only be returned if the authenticated user has both permission to view the container and permission to view
discussions in the container. Attempting to retrieve discussions for a container which the user does not have
access to will result in an
UNAUTHORIZED response.
When the discussions in the container are being searched the ordering of the returned discussions is by relevance
as opposed to by date.
GET http://domain:port/application_context/api/core/v2/spaces/{id}/discussions?limit=int&after=String&before=String&q=String&offset=int
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the identifier of the container for which the discussions are going to be returned. | |
Query Parameters
Name | Type | Description | Default Value |
---|
limit | int | the most dicussions which will be returned from this call. If there are fewer discussions available
in the given time period, if either before or after is provided, then fewer discussions will be returned then the
limit. | "25" |
after | String | disucssions newer than the date provided. So if the limit is 5 then the first 5 discussions created
after the provided date will be returned. The provided date is required to be formatted in
ISO 8601 format. | |
before | String | discussions older than the date provided. For a limit of 5 then the first 5 discussions created
before the provided date will be returned. The provided date is required to be formatted in
ISO 8601 format. | |
q | String | when provided, will search the discussions in the container using the given query. | |
offset | int | used in conjuction with query and paginating through discussions related to a search. | "0" |
Response
Type | Description |
---|
EntityCollection | a collection of discussions in the requested container ordered by the date they were created. |
Example
JSON Response Payload
{
"data" : [ {
"message" : {
"content" : {
"type" : "text",
"body" : "vpN7jU6yrJV991aTTgRaossuuyRR24L6gwCOVCg4daJvsRAdL8RDY1HQBw8wxnCNcQOpGxCx17DM010pnG6cXVNN0tezkD5AVboDNgKCylB5JGY5tmvU7T6e4lWvfCoM21TDMO70CMGRFhQV4yPaCqgoKR3803JacC2JQQdbDTIgeLPfk0rbXxD6Ata72625cr20H4FRCOroHaAVnksFmiBsJB051FC6gWWdaza74w5cGqZrbrcwmxbop7UabVE"
},
"status" : "published",
"subject" : "ZCRVSOzDltsWiQzgzyNd",
"id" : 1007,
"type" : 2,
"creationDate" : "2010-08-02T17:57:45.960+0000",
"modificationDate" : "2010-08-02T17:57:45.960+0000",
"links" : {
"alt" : "http://localhost:50001/oc/v1/messages/1007"
}
},
"replyCount" : 0,
"status" : "published",
"subject" : "ZCRVSOzDltsWiQzgzyNd",
"author" : {
"username" : "user-5bbpvrjql1t4ctbs",
"id" : 2023,
"type" : 3,
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/2023",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"id" : 1006,
"type" : 1,
"creationDate" : "2010-08-02T17:57:45.960+0000",
"modificationDate" : "2010-08-02T17:57:45.960+0000",
"links" : {
"alt" : "http://localhost:50001/oc/v1/discussions/1006",
"messages" : "http://localhost:50001/oc/v1/discussions/1006/messages"
}
}, {
"message" : {
"content" : {
"type" : "text",
"body" : "tIk1KodH7BTCL3ZOTH6W41ARDAugI9gCT4B2XwGdoT2p106n3f8jbIpzA7RVrjIXIK6HFvs2uN2DvnY2QmQP4J69AqeWndlmT4UsKvfwwrAKey7JLQZ0SOL3lFF3FhxhVMqJxZOebdjNPSaV4qJQZeP3qq3PB0uS318Y6qKItpSQerJuwOxmbCKGZGNYy2MuJCNrTVmFI3J2NKbVqPmxLStM7wymvBJqhswhvQsrUGUBrWKXecgCkoQqfIv7FIP"
},
"status" : "published",
"subject" : "H3sDt7NUbEL4t0CX14ZB",
"id" : 1006,
"type" : 2,
"creationDate" : "2010-08-02T17:57:45.945+0000",
"modificationDate" : "2010-08-02T17:57:45.945+0000",
"links" : {
"alt" : "http://localhost:50001/oc/v1/messages/1006"
}
},
"replyCount" : 0,
"status" : "published",
"subject" : "H3sDt7NUbEL4t0CX14ZB",
"author" : {
"username" : "user-oaobo2rqpudqopfc",
"id" : 2022,
"type" : 3,
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/2022",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"id" : 1005,
"type" : 1,
"creationDate" : "2010-08-02T17:57:45.945+0000",
"modificationDate" : "2010-08-02T17:57:45.945+0000",
"links" : {
"alt" : "http://localhost:50001/oc/v1/discussions/1005",
"messages" : "http://localhost:50001/oc/v1/discussions/1005/messages"
}
} ],
"links" : {
"next" : "http://localhost:50001/oc/v1/spaces/2053/discussions?limit=5&before=2010-08-02T17%253A57%253A45.888%252B0000",
"previous" : "http://localhost:50001/oc/v1/spaces/2053/discussions?limit=5&after=2010-08-02T17%253A57%253A45.960%252B0000"
}
}
Get documents
Returns a collection of documents in a particular container. The documents are sorted by their creation date
from newest to oldest and can be iterated through utilizing the date parameters since and until. Documents
will only be returned if the authenticated user has both permission to view the container and permission to view
documents in the container. Attempting to retrieve documents for a container which the user does not have
access to will result in an
UNAUTHORIZED response.
When the documents in the container are being searched the ordering of the returned documents is by relevance
as opposed to by date.
GET http://domain:port/application_context/api/core/v2/spaces/{id}/documents?limit=int&after=String&before=String&q=String&offset=int
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the identifier of the container for which the documents are going to be returned. | |
Query Parameters
Name | Type | Description | Default Value |
---|
limit | int | the most dicussions which will be returned from this call. If there are fewer documents available
in the given time period, if either before or after is provided, then fewer documents will be returned then the
limit. | "25" |
after | String | disucssions newer than the date provided. So if the limit is 5 then the first 5 documents created
after the provided date will be returned. The provided date is required to be formatted in
ISO 8601 format. | |
before | String | documents older than the date provided. For a limit of 5 then the first 5 documents created
before the provided date will be returned. The provided date is required to be formatted in
ISO 8601 format. | |
q | String | when provided, will search the documents in the container using the given query. | |
offset | int | used in conjuction with query and paginating through documents related to a search. | "0" |
Response
Type | Description |
---|
EntityCollection | a collection of documents in the requested container ordered by the date they were created |
Example
JSON Response Payload
{
"data" : [ {
"content" : {
"type" : "text/html",
"text" : "<body><!-- [DocumentBodyStart:2a06ccd8-b084-4724-a867-2572ab3d20d3] --><div class=\"jive-rendered-content\"><p>body-1282673665356</p></div><!-- [DocumentBodyEnd:2a06ccd8-b084-4724-a867-2572ab3d20d3] --></body>"
},
"status" : "published",
"subject" : "title-1282673665356",
"author" : {
"name" : "Administrator",
"username" : "admin",
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/1",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"replyCount" : 0,
"likeCount" : 0,
"creationDate" : "2010-08-24T18:14:25.356+0000",
"modificationDate" : "2010-08-24T18:14:25.360+0000",
"links" : {
"alt" : "http://localhost:50001/oc/v1/documents/1004",
"container" : "http://localhost:50001/oc/v1/spaces/2061"
}
}, {
"content" : {
"type" : "text/html",
"text" : "<body><!-- [DocumentBodyStart:4e89abc7-0832-4ff3-9e76-71f8d7733fab] --><div class=\"jive-rendered-content\"><p>body-1282673665345</p></div><!-- [DocumentBodyEnd:4e89abc7-0832-4ff3-9e76-71f8d7733fab] --></body>"
},
"status" : "published",
"subject" : "title-1282673665345",
"author" : {
"name" : "Administrator",
"username" : "admin",
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/1",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"replyCount" : 0,
"likeCount" : 0,
"creationDate" : "2010-08-24T18:14:25.345+0000",
"modificationDate" : "2010-08-24T18:14:25.349+0000",
"links" : {
"alt" : "http://localhost:50001/oc/v1/documents/1003",
"container" : "http://localhost:50001/oc/v1/spaces/2061"
}
}, {
"content" : {
"type" : "text/html",
"text" : "<body><!-- [DocumentBodyStart:94e41926-e8d5-49ee-bed1-5539d95d535f] --><div class=\"jive-rendered-content\"><p>body-1282673665334</p></div><!-- [DocumentBodyEnd:94e41926-e8d5-49ee-bed1-5539d95d535f] --></body>"
},
"status" : "published",
"subject" : "title-1282673665334",
"author" : {
"name" : "Administrator",
"username" : "admin",
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/1",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"replyCount" : 0,
"likeCount" : 0,
"creationDate" : "2010-08-24T18:14:25.334+0000",
"modificationDate" : "2010-08-24T18:14:25.338+0000",
"links" : {
"alt" : "http://localhost:50001/oc/v1/documents/1002",
"container" : "http://localhost:50001/oc/v1/spaces/2061"
}
}, {
"content" : {
"type" : "text/html",
"text" : "<body><!-- [DocumentBodyStart:1cb6e8aa-b09e-479c-9a01-ba14d3591026] --><div class=\"jive-rendered-content\"><p>body-1282673665322</p></div><!-- [DocumentBodyEnd:1cb6e8aa-b09e-479c-9a01-ba14d3591026] --></body>"
},
"status" : "published",
"subject" : "title-1282673665322",
"author" : {
"name" : "Administrator",
"username" : "admin",
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/1",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"replyCount" : 0,
"likeCount" : 0,
"creationDate" : "2010-08-24T18:14:25.322+0000",
"modificationDate" : "2010-08-24T18:14:25.327+0000",
"links" : {
"alt" : "http://localhost:50001/oc/v1/documents/1001",
"container" : "http://localhost:50001/oc/v1/spaces/2061"
}
}, {
"content" : {
"type" : "text/html",
"text" : "<body><!-- [DocumentBodyStart:7db9cb40-9e20-4bac-91f7-686f6a55a8e5] --><div class=\"jive-rendered-content\"><p>body-1282673665224</p></div><!-- [DocumentBodyEnd:7db9cb40-9e20-4bac-91f7-686f6a55a8e5] --></body>"
},
"status" : "published",
"subject" : "title-1282673665224",
"author" : {
"name" : "Administrator",
"username" : "admin",
"links" : {
"alt" : "http://localhost:50001/oc/v1/users/1",
"avatar" : "http://localhost:50001/oc/v1/avatars/default"
}
},
"replyCount" : 0,
"likeCount" : 0,
"creationDate" : "2010-08-24T18:14:25.224+0000",
"modificationDate" : "2010-08-24T18:14:25.281+0000",
"links" : {
"alt" : "http://localhost:50001/oc/v1/documents/1000",
"container" : "http://localhost:50001/oc/v1/spaces/2061"
}
} ],
"links" : {
"next" : "http://localhost:50001/oc/v1/spaces/2061/documents?limit=5&before=2010-08-24T18%253A14%253A25.224%252B0000",
"previous" : "http://localhost:50001/oc/v1/spaces/2061/documents?limit=5&after=2010-08-24T18%253A14%253A25.356%252B0000"
}
}
Get follower
Check if the user is following the specified container
GET http://domain:port/application_context/api/core/v2/spaces/{id}/followers/{userId}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the identifier of the container 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 projects
GET http://domain:port/application_context/api/core/v2/spaces/{id}/projects?limit=int&after=String&before=String
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | | |
Query Parameters
Name | Type | Description | Default Value |
---|
limit | int | | "25" |
after | String | | |
before | String | | |
Get space
Returns the space for the given identifier. If the authenciated user cannot view the given space then an
Unauthenticated respsonse will be returned. If the space does not exist then a
Not Found
response will be returned.
GET http://domain:port/application_context/api/core/v2/spaces/{id}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the identifier of the Space which is going to be returned. | |
Response
Type | Description |
---|
space | the space for the given identifier. |
Example
JSON Response Payload
{
"childCount" : 0,
"name" : "Community-DW8qHlpr",
"displayName" : "community-2xj33aiv",
"description" : "Description vB9dm0be",
"resources" : {
"content" : {
"ref" : "http://localhost:50001/core/v1/spaces/2085/content",
"allowed" : [ "GET" ]
},
"projects" : {
"ref" : "http://localhost:50001/core/v1/spaces/2085/projects",
"allowed" : [ "GET" ]
},
"follower" : {
"ref" : "http://localhost:50001/core/v1/spaces/2085/followers",
"allowed" : [ "POST" ]
},
"documents" : {
"ref" : "http://localhost:50001/core/v1/spaces/2085/documents",
"allowed" : [ "GET", "POST" ]
},
"parent" : {
"ref" : "http://localhost:50001/core/v1/spaces/2084",
"allowed" : [ "GET" ]
},
"activities" : {
"ref" : "http://localhost:50001/core/v1/spaces/2085/activities",
"allowed" : [ "GET" ]
},
"discussions" : {
"ref" : "http://localhost:50001/core/v1/spaces/2085/discussions",
"allowed" : [ "GET", "POST" ]
}
},
"id" : 2085,
"creationDate" : "2011-01-24T19:39:53.651+0000",
"modificationDate" : "2011-01-24T19:39:53.672+0000",
"viewCount" : 0
}
Get space parent
Returns the parent space for the given space. If the given space has no parent, it is at the system root, then
a
No Content response is returned.
GET http://domain:port/application_context/api/core/v2/spaces/{id}/parent
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the identifier for the space which is having its parent returned. | |
Response
Type | Description |
---|
space | the parent space of the given space. |
Example
JSON Response Payload
{
"childCount" : 1,
"name" : "Community-jPLUJktI",
"displayName" : "community-6378k0pr",
"contents" : [ {
"name" : "discussions",
"ref" : "http://localhost:50001/oc/v1/spaces/2050/parent/discussions"
}, {
"name" : "documents",
"ref" : "http://localhost:50001/oc/v1/spaces/2050/parent/documents"
} ],
"description" : "Description 4o9kKGY4",
"id" : 2049,
"type" : 14,
"creationDate" : "2010-08-02T17:57:44.197+0000",
"modificationDate" : "2010-08-02T17:57:44.215+0000"
}
Get spaces
Returns the top level spaces in the system. The list is paginated, the limit to the number of spaces returned by
this endpoint is determined by the provided limit method and more results can be obtained by specifying an
offset. The spaces which are visibile is determined by the authenticated users permissions in the system, if the
user cannot see a space it will not be represented in the returned listing
GET http://domain:port/application_context/api/core/v2/spaces?offset=int&limit=int
Query Parameters
Name | Type | Description | Default Value |
---|
offset | int | the number of results to skip when returning the list of top level spaces. This can be utilized
for pagination, if the client is already aware of the first 10 spaces than an offset of 10 can be provided in
order to omit those from the result. | "0" |
limit | int | the most spaces which will be returned from this call. If there are fewer spaces at the root level
then fewer spaces than the limit will be returned. | "25" |
Example
JSON Response Payload
{
"data" : [ {
"childCount" : 0,
"name" : "Getting Started",
"displayName" : "getting-started",
"contents" : [ {
"type" : "discussion",
"ref" : "http://localhost:50001/oc/v1/spaces/2001/discussions"
}, {
"type" : "document",
"ref" : "http://localhost:50001/oc/v1/spaces/2001/documents"
} ],
"description" : "New to Jive SBS? Start here to learn how to get the most out of it.",
"places" : [ {
"type" : "project",
"ref" : "http://localhost:50001/oc/v1/spaces/2001/projects"
} ],
"creationDate" : "2008-12-12T23:26:17.717+0000",
"modificationDate" : "2008-12-12T23:26:18.597+0000",
"viewCount" : 0,
"links" : {
"alt" : "http://localhost:50001/oc/v1/spaces/2001"
}
}, {
"childCount" : 0,
"name" : "Water Cooler",
"displayName" : "water-cooler",
"contents" : [ {
"type" : "discussion",
"ref" : "http://localhost:50001/oc/v1/spaces/2002/discussions"
}, {
"type" : "document",
"ref" : "http://localhost:50001/oc/v1/spaces/2002/documents"
} ],
"description" : "A place for topics that don't seem to fit anywhere else.",
"places" : [ {
"type" : "project",
"ref" : "http://localhost:50001/oc/v1/spaces/2002/projects"
} ],
"creationDate" : "2008-12-12T23:27:11.735+0000",
"modificationDate" : "2008-12-12T23:27:11.864+0000",
"viewCount" : 0,
"links" : {
"alt" : "http://localhost:50001/oc/v1/spaces/2002"
}
}, {
"childCount" : 0,
"name" : "Community-JmX277OQ",
"displayName" : "community-achc7kdt",
"contents" : [ {
"type" : "discussion",
"ref" : "http://localhost:50001/oc/v1/spaces/2003/discussions"
}, {
"type" : "document",
"ref" : "http://localhost:50001/oc/v1/spaces/2003/documents"
} ],
"description" : "Description f1xv8f74",
"places" : [ {
"type" : "project",
"ref" : "http://localhost:50001/oc/v1/spaces/2003/projects"
} ],
"creationDate" : "2010-09-29T18:38:02.030+0000",
"modificationDate" : "2010-09-29T18:38:02.092+0000",
"viewCount" : 0,
"links" : {
"alt" : "http://localhost:50001/oc/v1/spaces/2003"
}
}, {
"childCount" : 0,
"name" : "Community-GKNTSv59",
"displayName" : "community-4wkbktsv",
"contents" : [ {
"type" : "discussion",
"ref" : "http://localhost:50001/oc/v1/spaces/2004/discussions"
}, {
"type" : "document",
"ref" : "http://localhost:50001/oc/v1/spaces/2004/documents"
} ],
"description" : "Description lXkcE3lp",
"places" : [ {
"type" : "project",
"ref" : "http://localhost:50001/oc/v1/spaces/2004/projects"
} ],
"creationDate" : "2010-09-29T18:38:02.112+0000",
"modificationDate" : "2010-09-29T18:38:02.133+0000",
"viewCount" : 0,
"links" : {
"alt" : "http://localhost:50001/oc/v1/spaces/2004"
}
} ]
}
Get sub spaces
GET http://domain:port/application_context/api/core/v2/spaces/{id}/children?offset=int&limit=int
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | | |
Query Parameters
Name | Type | Description | Default Value |
---|
offset | int | | "0" |
limit | int | | "25" |
Share
POST http://domain:port/application_context/api/core/v2/spaces/{id}/share
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | | |
Unfollow
Stop following the specified container
DELETE http://domain:port/application_context/api/core/v2/spaces/{id}/followers/{userId}
Path Parameters
Name | Type | Description | Default Value |
---|
id | long | the identifier of the container. | |
userId | long | the id of the following user to be removed. | |