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

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

matthiasrousseau/confluence-rest-php-client
===========================================

Confluence API PHP Client

0.3.2(9y ago)00MITPHPPHP &gt;=5.5.0

Since Jul 7Pushed 6y agoCompare

[ Source](https://github.com/MatthiasRousseauAdFab/confluence-rest-php-client)[ Packagist](https://packagist.org/packages/matthiasrousseau/confluence-rest-php-client)[ RSS](/packages/matthiasrousseau-confluence-rest-php-client/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (7)Versions (13)Used By (0)

Confluence REST API PHP Client
==============================

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

[![Build Status](https://camo.githubusercontent.com/6e929920eaa8c3e05090e47ecb34305992abec27a42455d8c8808e09c5483a04/68747470733a2f2f7472617669732d63692e6f72672f61646c6f6769782f636f6e666c75656e63652d726573742d7068702d636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/adlogix/confluence-rest-php-client) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/d91a21d3fc77e3ed6c7209e7d9f7f58d6ee4badd04af750246eb599b8c4043a0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61646c6f6769782f636f6e666c75656e63652d726573742d7068702d636c69656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/adlogix/confluence-rest-php-client/?branch=master)

An Object Oriented wrapper for Confluence, written PHP5

tl;dr;
------

[](#tldr)

- **JWT**: Json Web Token [standard](http://jwt.io/), [atlassian version](https://developer.atlassian.com/static/connect/docs/latest/concepts/understanding-jwt.html), [Atlassian JWT Web decoder](http://jwt-decoder.herokuapp.com/jwt/decode) (use your query to get the QSH, use the query + the JWT token query param to validate it)
- **QSH**: [Query String Hash](https://developer.atlassian.com/static/connect/docs/latest/concepts/understanding-jwt.html#qsh)
- **Descriptor**: [Add-on Descriptor for Atlassian Connect](https://developer.atlassian.com/static/connect/docs/latest/modules/), [validate your descriptor against an atlassian product](https://atlassian-connect-validator.herokuapp.com/validate) (syntax check only)

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

[](#requirements)

- PHP &gt;= 5.5.0

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

[](#installation)

```
$ php composer.phar require adlogix/confluence-rest-php-client
```

Minimal Usage
-------------

[](#minimal-usage)

See the index.php at the root of this repository

Real life testing
-----------------

[](#real-life-testing)

The Atlassian Product you want to authenticate to needs to contact your application using some form of webhooks, so we created the most basic application we could do to show you how it can be accomplished.

Use docker-compose:

```
$ docker-compose up -d
```

### Use host names instead of ports

[](#use-host-names-instead-of-ports)

If you've launched the environment you already have a proxy running to redirect ngrok.dev and confluence-client.dev to the correct containers. You just have to put both domains to your host file or use a solution like [dnsmasq on OSX](https://passingcuriosity.com/2013/dnsmasq-dev-osx/), but be sure to redirect to your docker-machine IP.

To find your docker machine ip use:

```
$ docker-machine ip [machine-name]
```

### Get your development instance

[](#get-your-development-instance)

Atlassian changed the way to work on Confluence/Jira, now in order to create your plugin, you have to get a [Developer Account](http://go.atlassian.com/cloud-dev) and create your own instance. All the steps to create your environment are defined on the [documentation page](https://developer.atlassian.com/static/connect/docs/latest/guides/development-setup.html).

Once you have access to your own Atlassian Cloud instance and you put it in developer mode, we can continue and let the instance contact us.

### Exposing our local app to the world

[](#exposing-our-local-app-to-the-world)

The Atlassian app we trying to authenticate must post some information to us, so we need to expose our app on the internet. That's the reason we have a [ngrok](https://ngrok.com/) container running. ngrok is an application which will create a tunnel between our environment and their servers, letting us to be accessed from everywhere.

You should now have a ngrok container running at [ngrok.dev](http://ngrok.dev). When you connect you should see the tunnel url and, if you open it, all the tunnel trafic.

The url to use to install our demo application is https://\[your-tunnel-id\].eu.ngrok.io/descriptor.json

**Note:** Everytime you restart the ngrok container, the tunnel id will change, so you should reinstall your plugin each time. I know, it's bad.

### Update the `view/index.html.twig`file

[](#update-the-viewindexhtmltwigfile)

Be sure to update the view/index.html.twig to set the links to real content urls in order to be able to do the requests. Be sure to replace the base url to point to our api
