Skip to main content
Skip table of contents

REST API


You can create baselines through the public REST API.

The format for a Baseline Create call is as follows:

REST Call



Notes
HTTP MethodPOST
URL<confluence-server>/rest/baseline/1.0/baselineService/createBaseline
HeaderAuthorization: Basic <base64_encoded_username_password>

Use the username and password of the Confluence user used for this integration.

https://mixedanalytics.com/tools/basic-authentication-generator/

HeaderContent-Type: application/json
Body


Example

CODE
{
   "baselineName":"My Baseline",
   "spaceKey":"ABC",
   "selectAllPages":"false",
   "creationType":"version-based",
   "baselineKeyword":"",
   "baselineDate":"2022-12-31 12:34:56",
   "fullySelectedPages":[
      {
         "id":"3473425"
      }
   ],
   "partiallySelectedPages":[
      {
         "id":"3473421",
         "version":"2"
      },
      {
         "id":"3473423",
         "version":"latest"
      }
   ]
}

The JSON body here is shown as an example for all the report parameter values.

Not all of these parameters can be used together. Please see the parameter reference table further on this page.



ParameterDescriptionRequiredExample
confluence-serverThe full URL for your Confluence ServerYeshttp://192.668.0.71:6110/confluence611
spaceKeyThe key of the Confluence document space for which the baseline will be createdYesABC
baselineNameThe name of the baseline that will be createdYesMy New Baseline
creationType

How to pick page versions from each page's history. Two options:

  • date-based
  • version-based
Yes
  • date-based
  • version-based
baselineKeyword

(Optional) The keyword for the baseline. Any string works.

!!! Leave it empty if you are not sure how to use this.



baselineDateThe date and exact time for the baselineonly when creationType = date-based2018-09-12 11:08:12
selectAllPages

Whether all pages in the space will be included in the baseline

Possible values:

  • true
  • false

  • true
  • false
partiallySelectedPages

Used if "selectAllPages" is false

A list of page ID's that will be included in the baseline.

The pages in this list will be included in the baseline WITHOUT their subpages. 

  • For each page you can define a version explicitly or use the keyword "latest" to get the latest version of the page.
  • If version info is not present for a page, latest page version is assumed.

[
   {
      "id":"12345",
      "version":"latest"
   },
   {
      "id":"13564",
      "version":"3"
   },
   {
      "id":"13564"
   }
]

fullySelectedPages

Used if "selectAllPages" is false

A list of page ID's that will be included in the baseline.

The pages in this list will be included in the baseline WITH all their subpages. (Subpages will be included with their latest versions unless another version is explicitly defined)

  • For each page you can define a version explicitly or use the keyword "latest" to get the latest version of the page.
  • If version info is not present for a page, latest page version is assumed.



[
   {
      "id":"12345",
      "version":"latest"
   },
   {
      "id":"13564",
      "version":"3"
   },
   {
      "id":"13564"
   }
]






Result

The REST call will return a JSON text either confirming the creation of the baselines or error messages about parameters.

CODE
{
    "message": "Baseline My New Baseline 1 created with 14 page(s) and 21 attachment(s)",
    "warnings": []
}




JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.