https://github.com/the-oglow/ya-corapi
Yet Another Confluence Rest API
https://github.com/the-oglow/ya-corapi
confluence confluence-data-center data-center datacenter rest-api restapi
Last synced: about 1 month ago
JSON representation
Yet Another Confluence Rest API
- Host: GitHub
- URL: https://github.com/the-oglow/ya-corapi
- Owner: The-oGlow
- License: apache-2.0
- Created: 2025-06-17T06:18:50.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2025-09-04T12:39:53.000Z (about 1 month ago)
- Last Synced: 2025-09-04T14:38:07.520Z (about 1 month ago)
- Topics: confluence, confluence-data-center, data-center, datacenter, rest-api, restapi
- Language: PHP
- Homepage:
- Size: 341 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Yet Another Confluence REST API





(c) 2024 Oliver Glowa
# Description
Managing the maintenance of a confluence instance via REST API.
# Requirements
- Commandline
- Linux / Unix Shell or
- Windows Shell
- [PHP](https://www.php.net)
- [Composer](https://getcomposer.org/) (optional)# Configuration
## Unix / Linux
- Clone this repository to your local drive
- Create the folder
- `mkdir ${HOME}/.ya-corapi`
- Copy the file to the created folder
- `cp ./cfg/myauth.php.dist ${HOME}/.ya-corapi/myauth.php`
- Edit the file `${HOME}/.ya-corapi/myauth.php`
- Replace `#confluence-url_for_production#` with your Confluence URL for the production environment
- Replace `#confluence-url_for_testing#` with your Confluence URL for the testing environment## Windows
- Clone this repository to your local drive
- Create the folder
- `mkdir %USERPROFILE%\.ya-corapi`
- Copy the file to the created folder
- `copy .\cfg\myauth.php.dist %USERPROFILE%\.ya-corapi\myauth.php`
- Edit the file `%USERPROFILE%\.ya-corapi\myauth.php`
- Replace `#confluence-url_for_production#` with your Confluence URL for the production environment
- Replace `#confluence-url_for_testing#` with your Confluence URL for the testing environment# How to use it
The functions are separated in subfolders
- count -> Count specific pages / elements
- search -> Search for specific pages / elementsStarting a function is easy from the shell (commandline)
php -f .//.php
E.g.
php -f ./search/searchpage.php
The results are printed to the console or into a file in the target folder
./target///.
The output can be
- Text
- CSV
- JSON# Roadmap
## r0.1 (first release)
- Move code from PoC to OO
- Create simple write actions
- Create examples and describe their purpose
- Describe the installation and usage of this library## r0.2
- Decouple [`IConnectionProvider`](src/yacorapi/IConnectionProvider.php) to support different provider
- Externalize functions for the [Projectdoc Toolbox](https://www.smartics.eu/spaces/PDAC1/projectdoc-Toolbox_3671724.html) into its own library## r0.3
- Decouple the REST-API definitions to support different confluence versions (e.g. Cloud) or atlassian tools (e.g. Jira)
- Create write actions by batch## r0.4
- Code cleanup release
- Code coverage release
- Setup github actions## Near or Far Future
- Create an alternative provider
- Implement a Cloud fortifed REST-API definition# Development
Some infos, in case you want to fork and extend this library,
## Structure
Relevant files and folders
|--cfg
| |-mayauth.php.dist
| |-myspaces.php.dist
|
|--example
| |-*
|--src
| |-- Monolog
| |-- PHPUnit
| |-- yacorapi
|
|--target
| |- *
|
|--tests
| |--yacorapi
|
|--vendor
| |- *
|
|-composer.json
|-composer.lock
|-php-cs-fixer.php.dist
|-phpstan.neon.dist
|-phpunit.xml.dist
|-README.md
## UNIT Tests
Starting the unit tests (PHP Unit)
./vendor/bin/phpunit
## Quality Analysis| | Branch 'master' | Branch 'develop'
| :--- | :---: | :---:
| **Build**
| Github.com | - | -
| **Quality Information**
| Sonarcloud.io | - | [](https://sonarcloud.io/dashboard?id=The-oGlow_ya-corapi)
| **Test Information**
| Sonarcloud.io | [](https://sonarcloud.io/dashboard?id=The-oGlow_ya-corapi)
[](https://sonarcloud.io/dashboard?id=The-oGlow_ya-corapi)
[](https://sonarcloud.io/dashboard?id=The-oGlow_ya-corapi)
[](https://sonarcloud.io/dashboard?id=The-oGlow_ya-corapi)
| [](https://sonarcloud.io/dashboard?id=The-oGlow_ya-corapi)
[](https://sonarcloud.io/dashboard?id=The-oGlow_ya-corapi)
[](https://sonarcloud.io/dashboard?id=The-oGlow_ya-corapi)
[](https://sonarcloud.io/dashboard?id=The-oGlow_ya-corapi)[](https://sonarcloud.io/summary/new_code?id=The-oGlow_ya-corapi)
# Notice
- Examples are working with privat access token (PAT) only!
- Tested & Working with the Confluence Data Center Edition (DCE)
- By default the requests are sent to the URL of `#confluence-url_for_testing#`
- Edit the file `${HOME}/.ya-corapi/myauth.php` (Windows: `%USERPROFILE%\.ya-corapi\myauth.php`)
- Set `CONST USE_PROD = false` to `CONST USE_PROD = true`