Download PDF
Download page Using REST API with Scroll Versions.
Using REST API with Scroll Versions
This page describes the process how to use REST API with Scroll Versions.
There are also additional pages about specific REST resources and Publish with the REST API.
We do not officially support the REST API. So changes to it might occur without notice.
URL Overview
All URLs must be prepended by the following base URL: http://host[:port]/[contextPath]/rest/scroll-versions/1.0.
All endpoints are using application/json as the content type for request and responses.
Authentication
Before starting to request URLs, you need to be aware of the different authentication methods. You can authenticate yourself for the REST APIs in three ways:
- Log in to Confluence manually You will then be authenticated for the REST APIs for that same browser session.
- Use HTTP basic authentication (Authorization HTTP header) containing 'Basic username:password'.
username:password must be base64 encoded. The URL must also contain the 'os_authType=basic' query parameter.
- Using URL parameters You may specify your username and password in the URL using the 'os_username' and 'os_password' parameters. See below for examples.
If you want to use some non-browser tool like wget or curl, you have to use either HTTP basic authentication or URL parameters.
If you encounter the problem "XSRF check failed" while accessing the REST API, you should add the header "X-Atlassian-Token:nocheck" to your request.
curl
Curl is a command line tool for transferring data with URL syntax. It is preinstalled on macOS and available for all Linux distributions using the package manager. There are also builds for Windows available.
You can use curl using the command line as follows. On macOS and Linux please make sure to place the URL in double quotes as otherwise the "&" character inside the URL will break the command.
HTTP basic authentication:
curl --remote-header-name --remote-name -u admin:admin "http://www.example.com/confluence/rest/scroll-versions/1.0/version/ds?os_authType=basic"
URL parameter based authentication:
curl --remote-header-name --remote-name "http://www.example.com/confluence/rest/scroll-versions/1.0/version/ds?os_username=admin&os_password=admin"
In some cases the colons are replaced with '&3A'. Please check the permalink carefully and edit it if necessary.
If you want to call curl from a script, the "-f" parameter may be interesting as it will make curl return some non-zero value in case of download errors. See the curl documentation for more info.
wget
wget is another command line tool for transferring data with URL syntax. It is available for all major platforms.
You can use wget using the command line as follows. On macOS and Linux please make sure to place the URL in double quotes as otherwise the "&" character inside the URL will break the command.
HTTP basic authentication:
wget --content-disposition --http-user=admin --http-password=admin "http://www.example.com/confluence/rest/scroll-version/1.0/version/ds?os_authType=basic"
URL parameter based authentication:
wget --content-disposition "http://www.example.com/confluence/rest/scroll-version/1.0/version/ds?os_username=admin&os_password=admin"
Other Tools
If you use other tools, you can compose the URL as described below.
HTTP basic authentication
[http://www.example.com/confluence/rest/scroll-version/1.0/version/ds?os_authType=basic]
URL parameter based authentication
[http://www.example.com/confluence/rest/scroll-version/1.0/version/ds?os_username=admin&os_password=admin]