history,space,version.
* @param limit the limit of the number of items to return, this may be restricted by fixed system limits.
* @param start the start point of the collection to return.
* @param postingDay the posting day of the blog post. Required for blogpost type. Format: yyyy-mm-dd. Example: 2013-02-13
* @param ids a list of content ids to fetch.
* @param title the title of the page to find. Required for page type.
* @param type the content type to return. Default value: page. Valid values: page, blogpost. All types are returned if fetching via list of IDS
* @param status list of statuses the content to be found is in. Defaults to current is not specified. If set to 'any', content in 'current' and 'trashed' status will be fetched. Does not support 'historical' status for now.
* @returns any Returns a full JSON representation of a list of content.
* @throws ApiError
*/
public static getContent(
spaceKey?: string,
expand?: string,
limit?: string,
start?: string,
postingDay?: string,
ids?: string,
title?: string,
type?: string,
status?: string,
): CancelablePromise<{
results?: Arrayhistory,space,version
* @param status list of Content statuses to filter results on.
*
* Default value: [current].
* @returns Content returns a JSON representation of the content.
* @throws ApiError
*/
public static createContent(
requestBody: Content,
expand?: string,
status?: string,
): CancelablePromisehistory,space,version.
*
* We can also specify some extensions such as extensions.inlineProperties (for getting inline comment-specific properties) or extensions.resolution for the resolution status of each comment in the results
* @param version version of the content.
* @param status list of Content statuses to filter results on.
*
* Default value: [current].
* @returns Content returns a JSON representation of the content, or a 404 NOT FOUND if there is no content with the given id or if the user is not permitted.
* @throws ApiError
*/
public static getContentById(
id: string,
expand?: string,
version?: string,
status?: string,
): CancelablePromisepreviousVersion,nextVersion,lastUpdated.
* @returns History Returns a full JSON representation of the content's history
* @throws ApiError
*/
public static getHistory(
id: string,
expand?: string,
): CancelablePromisehistory,space,version.
* @param limit the limit of the number of items to return, this may be restricted by fixed system limits.
* @param type the content type to return. Default value: page. Valid values: page, blogpost, comment. All types are returned if fetching via list of IDS. Type is only required for first request, latest request will user cursor
* @param status list of statuses the content to be found is in. Defaults to current is not specified. If set to 'any', content in 'current' and 'trashed' status will be fetched. Does not support 'historical' status for now.
* @returns any returns a JSON representation of the list of content.
* @throws ApiError
*/
public static scanContent(
cursor?: string,
spaceKey?: string,
expand?: string,
limit?: string,
type?: string,
status?: string,
): CancelablePromise<{
nextCursor?: string;
prevCursor?: string;
results?: Arrayhistory,space,version.
* @param limit the limit of the number of items to return, this may be restricted by fixed system limits.
* @param start the start point of the collection to return.
* @param cql a cql query string to use to locate content.
* @returns any returns a paginated list of content.
* @throws ApiError
*/
public static search(
cqlcontext?: string,
expand?: string,
limit?: string,
start?: string,
cql?: string,
): CancelablePromise<{
results?: ArrayNew page data.
", * "representation":"storage" * } * } * } * ``` * * To update a page and change its parent page, supply the `ancestors` property with the request with the parent as the first ancestor i.e. to move a page to be a child of page with ID 789: * * `PUT /rest/api/content/456` * * ```json * { * "version":{ * "number": 2 * }, * "ancestors": [{"id":789}], * "type":"page", * "body":{ * "storage":{ * "value":"New page data.
", * "representation":"storage" * } * } * } * ``` * * Changing status * * To restore a piece of content that has the status of trashed the content must have it's `version` incremented, and `status` set to `current`. No other field modifications will be performed when restoring a piece of content from the trash. * * Request example to restore from trash: `{"id": "557059","status": "current","version": {"number": 2}}` * * If the content you're updating has a draft, specifying `status=draft` will delete that draft and the `body` of the content will be replaced with the `body` specified in the request. * * Request example to delete a draft: * * `PUT: http://localhost:9096/confluence/rest/api/content/2149384202?status=draft` * * ```json * { * "id":"2149384202", * "status":"current", * "version":{ * "number":4 * }, * "space":{ * "key":"TST" * }, * "type":"page", * "title":"page title", * "body":{ * "storage":{ * "value":"New page data.
", * "representation":"storage" * } * } * } * ``` * * Changing page position * * To set page position, supply the `position` property in the request body with a positive integer. Content with unset positions will have a `position` value of -1. To unset a content position, supply `position` property with -1. * * Request example to set page position to 1 * * `PUT /rest/api/content/2149384202` * * ```json * { * "id":"2149384202", * "version":{ * "number":2 * }, * "type":"page", * "title":"page title", * "position":1 * } * ``` * * Request example to unset page position * * `PUT /rest/api/content/2149384202` * * ```json * { * "id":"2149384202", * "version":{ * "number":2 * }, * "type":"page", * "position":-1 * } * ``` * * * @param contentId the id of the content. * @param requestBody new content to be created. * @param asyncReconciliation * @param conflictPolicy the conflict policy, default value:abort
* @param status the existing status of the content to be updated.
* @returns Content Returns a full JSON representation of a piece of content.
* @throws ApiError
*/
public static update2(
contentId: string,
requestBody: Content,
asyncReconciliation: boolean = false,
conflictPolicy?: string,
status?: string,
): CancelablePromise {
return __request(OpenAPI, {
method: 'PUT',
url: '/rest/api/content/{contentId}',
path: {
'contentId': contentId,
},
query: {
'asyncReconciliation': asyncReconciliation,
'conflictPolicy': conflictPolicy,
'status': status,
},
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Returned if no space or no content type, or setup a wrong version type set to content, or status param is not draft and status content is current`,
404: `Returned if can not find draft with current content.`,
},
});
}
}