PHPackages                             lesstif/confluence-rest-api - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. lesstif/confluence-rest-api

ActiveLibrary[HTTP &amp; Networking](/categories/http)

lesstif/confluence-rest-api
===========================

Confluence REST API Client for PHP Users.

0.3(4y ago)1713.8k↓56.3%12[2 issues](https://github.com/lesstif/confluence-rest-api/issues)Apache-2.0PHPPHP ^7.3|^8.0CI failing

Since Jan 10Pushed 4y ago1 watchersCompare

[ Source](https://github.com/lesstif/confluence-rest-api)[ Packagist](https://packagist.org/packages/lesstif/confluence-rest-api)[ RSS](/packages/lesstif-confluence-rest-api/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (4)Dependencies (10)Versions (7)Used By (0)

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

[](#php-confluence-rest-client)

Atlassian's Confluence &amp; Confluence Question REST API Client for PHP Users.

installation
------------

[](#installation)

1. Install PHP Composer manually or download it from [composer home page](https://getcomposer.org/download/).

    ```
    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
    php composer-setup.php
    php -r "unlink('composer-setup.php');"
    ```
2. run composer for install dependency.

    ```
    php composer.phar require 'lesstif/confluence-rest-api'
    ```

or update your composer.json.

```
"require": {
    "lesstif/confluence-rest-api": "^0.1"
}

```

Configuration
-------------

[](#configuration)

you can choose loads environment variables either 'dotenv' or 'array'.

### use dotenv

[](#use-dotenv)

copy .env.example file to .env on your project root directory.

```
CONFLUENCE_HOST="https://your-confluence.host.com"
CONFLUENCE_USER="confluence-username"
CONFLUENCE_PASS="confluence-password"

```

### use array

[](#use-array)

create Service class with ArrayConfiguration parameter.

```
use Lesstif\Confluence\Question\QuestionService;

$qs = new QuestionService(new \Lesstif\Confluence\Configuration\ArrayConfiguration(
          [
              'host' => 'https://your-confluence.host.com',
              'user' => 'confluence-username',
              'password' => 'confluence-password',
          ]
   ));
```

Usage
=====

[](#usage)

CQL
---

[](#cql)

```
$cql = [
    'SPACE' => 'LAR',
    'type' => 'page',
    ];

try {
    $s = new CQLService();

    $ret = $s->search($cql);

    dump($ret);

} catch (\Lesstif\Confluence\ConfluenceException $e) {
    $this->assertTrue(false, 'testSearch Failed : '.$e->getMessage());
}
```

Question
--------

[](#question)

### getting Question list

[](#getting-question-list)

```
$queryParam = [
    // the number of questions needed (10 by default)
    'limit' => 10,

    //the start index (0 by default)
    'start' => 0,

    // The optional filter string which value is one of "unanswered", "popular", "my", "recent"
    // (default value 'recent')
    'filter' => 'unanswered',
];

try {
    $qs = new QuestionService();

    $questions = $qs->getQuestion($queryParam);

    foreach($questions as $q) {
        echo sprintf("%s\n", $q->url, $q->title);
    }

} catch (\Lesstif\Confluence\ConfluenceException $e) {
    $this->assertTrue(false, 'testSearch Failed : '.$e->getMessage());
}
```

### getting Question's detail info.

[](#getting-questions-detail-info)

```
try {
    $qs = new QuestionService();

    $q = $qs->getQuestionDetail($questionId);

    foreach($q->answers as $a)
    {
        // print accepted answer
        if ($a->accepted === true) {
            dump($a);
        }
    }

} catch (\Lesstif\Confluence\ConfluenceException $e) {
    $this->assertTrue(false, 'testSearch Failed : '.$e->getMessage());
}
```

### getting accepted answer

[](#getting-accepted-answer)

```
try {
    $qs = new QuestionService();

    $q = $qs->getAcceptedAnswer($questionId);
    dump($q);

} catch (\Lesstif\Confluence\ConfluenceException $e) {
    $this->assertTrue(false, 'testSearch Failed : '.$e->getMessage());
}
```

Answer
------

[](#answer)

### getting user's answer list

[](#getting-users-answer-list)

```
try {
    $username = 'lesstif';

    $as = new AnswerService();

    $ans = $as->getAnswers($username);

    foreach($ans as $a) {
        dump($a);
    }

} catch (\Lesstif\Confluence\ConfluenceException $e) {
    $this->assertTrue(false, 'testSearch Failed : '.$e->getMessage());
}
```

### getting related question.

[](#getting-related-question)

```
try {
    $answerId = '123456';

    $as = new AnswerService();

    $q = $as->getQuestion($answerId);

    dump($q);
} catch (\Lesstif\Confluence\ConfluenceException $e) {
    $this->assertTrue(false, 'testSearch Failed : '.$e->getMessage());
}
```

Confluence Rest API Documents
=============================

[](#confluence-rest-api-documents)

- Confluence Server REST API -
- latest server -
- Confluence Question REST API -

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

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

###  Release Activity

Cadence

Every ~586 days

Total

4

Last Release

1691d ago

PHP version history (2 changes)0.1PHP &gt;=5.5.0

0.3PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/45f736b85898f90b858e889fa4baaedfbf9868ca91dec91bbea54e4630db1c0f?d=identicon)[lesstif](/maintainers/lesstif)

---

Top Contributors

[![lesstif](https://avatars.githubusercontent.com/u/404534?v=4)](https://github.com/lesstif "lesstif (29 commits)")[![findstar](https://avatars.githubusercontent.com/u/1266944?v=4)](https://github.com/findstar "findstar (1 commits)")

---

Tags

restConfluenceconfluence-phpconfluence-rest

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/lesstif-confluence-rest-api/health.svg)

```
[![Health](https://phpackages.com/badges/lesstif-confluence-rest-api/health.svg)](https://phpackages.com/packages/lesstif-confluence-rest-api)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[laravel/framework

The Laravel Framework.

34.8k532.1M19.4k](/packages/laravel-framework)[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M514](/packages/shopware-core)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9317.2k55](/packages/open-dxp-opendxp)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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