PHPackages                             slavytuch/confluence-php-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. slavytuch/confluence-php-client

ActiveLibrary[API Development](/categories/api)

slavytuch/confluence-php-client
===============================

Provides methods for Confluence REST APIs

04PHP

Since Nov 5Pushed 1y agoCompare

[ Source](https://github.com/slavytuch/confluence-php-client)[ Packagist](https://packagist.org/packages/slavytuch/confluence-php-client)[ RSS](/packages/slavytuch-confluence-php-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Confluence PHP Client
=====================

[](#confluence-php-client)

[![CI](https://github.com/CloudPlayDev/confluence-php-client/actions/workflows/ci.yml/badge.svg)](https://github.com/CloudPlayDev/confluence-php-client/actions/workflows/ci.yml) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/cb5844a529f945948365f0847ba28985e9282c8a4f1c46125884e8c4354c3f15/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f436c6f7564506c61794465762f636f6e666c75656e63652d7068702d636c69656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/CloudPlayDev/confluence-php-client/?branch=main)

A Confluence RESTful API client in PHP

An Object Oriented wrapper for Confluence

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1.0

Installation
------------

[](#installation)

```
$ composer require slavytuch/confluence-php-client
```

Usage
-----

[](#usage)

### Authentication

[](#authentication)

#### Using Personal Access Tokens

[](#using-personal-access-tokens)

```
use CloudPlayDev\ConfluenceClient\ConfluenceClient;

$client = new ConfluenceClient('https://url-to-conluence');

//authenticate with a private access token
//@see https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html
$client->authenticate('NjU2OTA4NDI2MTY5OkBznOUO8YjaUF7KoOruZRXhILJ9');
```

#### Using BaseAuth

[](#using-baseauth)

```
$client = new ConfluenceClient('https://USERNAME:PASSWORD@url-to-conluence');
```

or

```
use CloudPlayDev\ConfluenceClient\ConfluenceClient;

$client = new ConfluenceClient('https://url-to-conluence');
$client->authenticateBasicAuth('USERNAME', 'PASSWORD');
```

### Fetch pages, comments and attachments

[](#fetch-pages-comments-and-attachments)

#### Find pages by title and space key

[](#find-pages-by-title-and-space-key)

```
/* @var $client CloudPlayDev\ConfluenceClient\ConfluenceClient */

//Get the page we created
$searchResults = $client->content()->find([
    'spaceKey' => 'testSpaceKey',
    'title' => 'Test'
]);

//first page
$createdPage = $searchResults->getResultAt(0);
```

#### Browse content with pagination

[](#browse-content-with-pagination)

```
/* @var $client CloudPlayDev\ConfluenceClient\ConfluenceClient */

$limit = 100;
$start = 10;

//Get the search results with pagination
$searchResults = $client->content()->find([
    'spaceKey' => 'testSpaceKey',
    'title' => 'Test'
], $limit, $start);

//check if there are more results
while(!$searchResults->isLastPage()) {
    //get the next pages
    $nextPages = $client->content()->find([
        'spaceKey' => 'testSpaceKey',
        'title' => 'Test'
    ], $limit, $searchResults->getStart() + $limit);
}
```

#### Fetch a page or comment by content id

[](#fetch-a-page-or-comment-by-content-id)

```
/* @var $client CloudPlayDev\ConfluenceClient\ConfluenceClient */

//Get a page or comment
$resultContent = $client->content()->get(1234567890);
```

#### Fetch old versions of a page or comment by content id

[](#fetch-old-versions-of-a-page-or-comment-by-content-id)

```
/* @var $client CloudPlayDev\ConfluenceClient\ConfluenceClient */

//Get a page or comment in a specific version
$resultContentInVersion2 = $client->content()->get(1234567890, 2);
```

#### Fetch page descendants

[](#fetch-page-descendants)

```
use CloudPlayDev\ConfluenceClient\Api\Content;
/* @var $client CloudPlayDev\ConfluenceClient\ConfluenceClient */
/* @var $page CloudPlayDev\ConfluenceClient\Entity\ContentPage */

//get child content
$childContent = $client->content()->children($page, Content::CONTENT_TYPE_PAGE); //\CloudPlayDev\ConfluenceClient\Entity\ContentSearchResult
```

#### Fetch content history

[](#fetch-content-history)

```
use CloudPlayDev\ConfluenceClient\Api\Content;
/* @var $client CloudPlayDev\ConfluenceClient\ConfluenceClient */

$pageId = 2323232323;
$historyData = $client->content()->history($pageId); // \CloudPlayDev\ConfluenceClient\Entity\ContentHistory
```

### Manipulating content

[](#manipulating--content)

#### Create new page

[](#create-new-page)

```
use CloudPlayDev\ConfluenceClient\Entity\ContentPage;
/* @var $client CloudPlayDev\ConfluenceClient\ConfluenceClient */

//Create a confluence content page
$page = new ContentPage();

//Configure your page
$page->setSpace('testSpaceKey')
    ->setTitle('Test')
    ->setContent('test page');

//Create the page in confluence in the test space
$client->content()->create($page);
```

#### Create new comment

[](#create-new-comment)

```
/* @var $client CloudPlayDev\ConfluenceClient\ConfluenceClient */

//get a page by id
$page = $client->content()->get(123456789);

//attach a comment to the page
$comment = $page->createComment('my comment text');

//save the comment
$client->content()->create($comment);
```

#### Create subpage

[](#create-subpage)

```
/* @var $client CloudPlayDev\ConfluenceClient\ConfluenceClient */

//get a page by id
$page = $client->content()->get(123456789);

//attach a subpage to page
$subPage = $page->createSubpage('subpage title', 'subpage content');

//save the page
$client->content()->create($subPage);
```

#### Update content

[](#update-content)

```
/* @var $client CloudPlayDev\ConfluenceClient\ConfluenceClient */

//get content by id
$page = $client->content()->get(123456789);

//change content
$page->setContent('new content')
    ->setTitle('new title');

//save the changes
$client->content()->update($page);
```

#### Delete content

[](#delete-content)

```
/* @var $client CloudPlayDev\ConfluenceClient\ConfluenceClient */

//get content by id
$page = $client->content()->get(123456789);

//delete content
$client->content()->delete($page);
```

FAQ
===

[](#faq)

How to authenticate with Confuence cloud?
-----------------------------------------

[](#how-to-authenticate-with-confuence-cloud)

You have to use basic auth with your username and password. You can also use a personal access token instead of your password. See [Using personal access tokens](https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html) for more information.

Create a new API token here:

```
use CloudPlayDev\ConfluenceClient\ConfluenceClient;

$client = new ConfluenceClient('https://xxxxxxxx.atlassian.net/wiki/');
$client->authenticateBasicAuth('USERNAME', 'TOKEN');
```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 Bus Factor1

Top contributor holds 91.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d1c0dcd1486de939747b4fb303847e9225ecd1d80d5ad1e023875d40efc4933c?d=identicon)[slavytuch](/maintainers/slavytuch)

---

Top Contributors

[![astepin](https://avatars.githubusercontent.com/u/297617?v=4)](https://github.com/astepin "astepin (33 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![lxxps](https://avatars.githubusercontent.com/u/5352993?v=4)](https://github.com/lxxps "lxxps (1 commits)")[![v-luchko-intensa](https://avatars.githubusercontent.com/u/175608955?v=4)](https://github.com/v-luchko-intensa "v-luchko-intensa (1 commits)")

### Embed Badge

![Health badge](/badges/slavytuch-confluence-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/slavytuch-confluence-php-client/health.svg)](https://phpackages.com/packages/slavytuch-confluence-php-client)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
