Info |
---|
Available since v. 2.3.0 New REST APIs:
Available since v. 2.11.0 New REST API:
Available since v. 2.39.0
Available since v. 3.12.* New REST API: Available since v. 3.16.* Below REST APIs are now available to space administrators: Available since v. 4.9.*
Available since v. 4.16.*
Available since v. 4.21.*
|
Get space
Available only for Confluence Administrators or Space Administrator
This API supports optional parameters
Method type:
Status | ||||
---|---|---|---|---|
|
URL: {CONFLUENCE_URL}/rest/extender/1.0/space/getSpace/{SPACE_KEY}
Parameters:
dateFormat - define date format for parameters creationDateFrom, creationDateTo and for JSON output fields creationDateString, lastModificationDateString, lastPermissionModificationDateString - default format ‘yyyy-MM-dd'
Example URL:
{CONFLUENCE_URL}/rest/extender/1.0/space/getSpace/MYSPACE?dateFormat=MM/dd/yyyy
{CONFLUENCE_URL}/rest/extender/1.0/space/getSpace/DEMO?dateFormat=MM.dd.yyyy
Response format: JSON
Example response:
Code Block | ||||
---|---|---|---|---|
| ||||
{ "creationDateString": "05-14-2020 14:53:21", "lastModificationDate": 1589460802858, "lastModificationDateString": "05-14-2020 14:53:22", "lastContentModificationDate": 1631157477946, "lastContentModificationDateString": "2021-09-09 05:17:57", "lastPermissionModificationDate": 1631157477946, "lastPermissionModificationDateString": "2021-09-09 05:17:57", "creatorName": "admin", "name": "Space A", "creationDate": 1589460801648, "key": "SPACEA", "status": "current" } |
Get all spaces
Available only for Confluence Administrators
This API supports Pagination
This API supports optional parameters
Method type:
Status | ||||
---|---|---|---|---|
|
URL: {CONFLUENCE_URL}/rest/extender/1.0/space/getAllSpaces
Parameters:
creationDateFrom - filter spaces by created date (creation date >= this date)
creationDateTo - filter spaces by created date (creation date <= this date)
lastPermissionModificationDateFrom - filter spaces by last permission modification date (last permission modification date >= this date)
lastPermissionModificationDateTo - filter spaces by last permission modification date (last permission modification date <= this date)
dateFormat - define date format for parameters creationDateFrom, creationDateTo and for JSON output fields creationDateString, lastModificationDateString, lastPermissionModificationDateString - default format ‘yyyy-MM-dd'
spacesAsArray - change ‘spaces’ parameter in response from HashMap to Array (Available since v. 4.8.0)
Example URL:
{CONFLUENCE_URL}/rest/extender/1.0/space/getAllSpaces?spacesAsArray=true
{CONFLUENCE_URL}/rest/extender/1.0/space/getAllSpaces?creationDateTo=2020-05-14
{CONFLUENCE_URL}/rest/extender/1.0/space/getAllSpaces?lastPermissionModificationDateTo=2020-05-14
{CONFLUENCE_URL}/rest/extender/1.0/space/getAllSpaces?creationDateFrom=12/01/2019&dateFormat=MM/dd/yyyy
{CONFLUENCE_URL}/rest/extender/1.0/space/getAllSpaces?creationDateTo=03.01.2020&creationDateFrom=01.01.2020&dateFormat=MM.dd.yyyy
{CONFLUENCE_URL}/rest/extender/1.0/space/getAllSpaces?lastPermissionModificationDateTo=03.01.2020&creationDateFrom=01.01.2020&dateFormat=MM.dd.yyyy
Response format: JSON
Example response:
Without spacesAsArray
Code Block | ||
---|---|---|
| ||
{ "total": 2, "maxResults": 100, "spaces": { "SPACEA": { "creationDateString": "05-14-2020 14:53:21", "lastModificationDate": 1589460802858, "lastModificationDateString": "05-14-2020 14:53:22", "lastContentModificationDate": 1631157477946, "lastContentModificationDateString": "2021-09-09 05:17:57", "lastPermissionModificationDate": 1631157477946, "lastPermissionModificationDateString": "2021-09-09 05:17:57", "creatorName": "admin", "name": "Space A", "creationDate": 1589460801648, "key": "SPACEA", "status": "current" }, "ds": { "creationDateString": "09-25-2018 11:05:32", "lastModificationDate": 1573637171250, "lastModificationDateString": "11-13-2019 10:26:11", "lastContentModificationDate": 1631157477946, "lastContentModificationDateString": "2021-09-09 05:17:57", "lastPermissionModificationDate": 1631157477946, "lastPermissionModificationDateString": "2021-09-09 05:17:57", "creatorName": "not exist", "name": "Demonstration Space", "creationDate": 1537866332331, "key": "ds", "status": "archived" } }, "startAt": 0 } |
With spacesAsArray = true
Code Block | ||
---|---|---|
| ||
{ "total": 2, "maxResults": 100, "spaces": [ { "creationDateString": "05-14-2020 14:53:21", "lastModificationDate": 1589460802858, "lastModificationDateString": "05-14-2020 14:53:22", "lastContentModificationDate": 1631157477946, "lastContentModificationDateString": "2021-09-09 05:17:57", "lastPermissionModificationDate": 1631157477946, "lastPermissionModificationDateString": "2021-09-09 05:17:57", "creatorName": "admin", "name": "Space A", "creationDate": 1589460801648, "key": "SPACEA", "status": "current" }, { "creationDateString": "09-25-2018 11:05:32", "lastModificationDate": 1573637171250, "lastModificationDateString": "11-13-2019 10:26:11", "lastContentModificationDate": 1631157477946, "lastContentModificationDateString": "2021-09-09 05:17:57", "lastPermissionModificationDate": 1631157477946, "lastPermissionModificationDateString": "2021-09-09 05:17:57", "creatorName": "not exist", "name": "Demonstration Space", "creationDate": 1537866332331, "key": "ds", "status": "archived" } ], "startAt": 0 } |
Change space status
Available only for Confluence Administrators or Space Administrator
Method type:
Status | ||||
---|---|---|---|---|
|
URL: {CONFLUENCE_URL}/rest/extender/1.0/space/changeSpaceStatus
Request format: JSON
Example request:
Code Block | ||
---|---|---|
| ||
{ "spaceKey": "SPACEKEY", "status": "archived" } |
Code Block | ||
---|---|---|
| ||
{ "spaceKey": "SPACEKEY", "status": "current" } |
spaceKey
- required - new key for modified space
status
- required - (archived or current) - space status
Change space key
Available only for Confluence Administrators
Method type:
Status | ||||
---|---|---|---|---|
|
URL: {CONFLUENCE_URL}/rest/extender/1.0/space/changeSpaceKey
Request format: JSON
Example request:
Code Block | ||
---|---|---|
| ||
{ "currentSpaceKey": "KEYA", "newSpaceKey": "NEWKEY", "reindexSpace": true } |
Code Block | ||
---|---|---|
| ||
{ "currentSpaceKey": "KEYA", "newSpaceKey": "NEWKEY" } |
currentSpaceKey
- required - key of the space you want to modify
newSpaceKey
- required - new key for modified space
reindexSpace
- optional - (true or false - default value: false) - reindex flag
Info |
---|
Space reindex is synchronous, if . If you set it to true, the response time will depend on the amount of contents content in the space. If you do not set the reindex flag, the search results in the application will return pages with the old space key, in this situation . In this case, you have to reindex content manually in Content Index Administration |
Response format: JSON
Pagination
This REST API uses pagination to improve performance for all users. Pagination is enforced for methods that could return a large collection of items. When you make a request to a paged API, the response will wrap the returned array of values in a JSON object with paging metadata, for example:
Code Block | ||||
---|---|---|---|---|
| ||||
{ "startAt" : 0, "maxResults" : 10, "total": 200, "objects": [ { /* result 0 */ }, { /* result 1 */ }, { /* result 2 */ } ] } |
Where:
startAt
is the index of the first item returned in the page of results.maxResults
is the maximum number of items that can be returned per page. Each API endpoint may have a different limit for the number of items returned, and these limits may change without notice. (default value - 100)total
is the total number of items contained in all pages. This number may change as the client requests the subsequent pages, therefore the client should always assume that the requested page can be empty.