PHPackages                             cloudplaydev/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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. cloudplaydev/confluence-php-client

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

cloudplaydev/confluence-php-client
==================================

Provides methods for Confluence REST APIs

0.6.0(2y ago)730.1k↓25.8%7[1 issues](https://github.com/CloudPlayDev/confluence-php-client/issues)[1 PRs](https://github.com/CloudPlayDev/confluence-php-client/pulls)MITPHPPHP ^7.4 || ^8.1CI passing

Since Jun 22Pushed 3mo ago1 watchersCompare

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

READMEChangelog (9)Dependencies (17)Versions (13)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 cloudplaydev/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

42

—

FairBetter than 90% of packages

Maintenance51

Moderate activity, may be stable

Popularity35

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.3% 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.

###  Release Activity

Cadence

Every ~109 days

Recently: every ~245 days

Total

10

Last Release

808d ago

PHP version history (3 changes)0.0.1PHP ^7.4

0.2.1PHP ^7.4 || ^8.0

0.4.0PHP ^7.4 || ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/0009557281f65ab29ecb72848075bdea1a1766976a5333a3e778cf370c80a328?d=identicon)[astepin](/maintainers/astepin)

---

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)")

---

Tags

confluence-apipsr-7rest-apiphpapiclientAuthenticationatlassianConfluence

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15224.3M65](/packages/opensearch-project-opensearch-php)[mozex/anthropic-php

Anthropic PHP is a supercharged community-maintained PHP API client that allows you to interact with Anthropic API.

46365.1k13](/packages/mozex-anthropic-php)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[laudis/neo4j-php-client

Neo4j-PHP-Client is the most advanced PHP Client for Neo4j

184616.9k31](/packages/laudis-neo4j-php-client)

PHPackages © 2026

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