{"id":19959739,"url":"https://github.com/maxlen/confluence-php-client","last_synced_at":"2025-07-02T15:34:21.147Z","repository":{"id":194997228,"uuid":"692042929","full_name":"maxlen/confluence-php-client","owner":"maxlen","description":"Provides methods for Confluence REST APIs","archived":false,"fork":false,"pushed_at":"2023-09-15T14:25:00.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T16:23:50.317Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxlen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-15T12:43:01.000Z","updated_at":"2024-01-04T21:35:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"6cc2e3b1-74ac-456b-83c6-bcbd98ad1009","html_url":"https://github.com/maxlen/confluence-php-client","commit_stats":null,"previous_names":["maxlen/confluence-php-client"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/maxlen/confluence-php-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlen%2Fconfluence-php-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlen%2Fconfluence-php-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlen%2Fconfluence-php-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlen%2Fconfluence-php-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxlen","download_url":"https://codeload.github.com/maxlen/confluence-php-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlen%2Fconfluence-php-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261372521,"owners_count":23148841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T01:51:20.699Z","updated_at":"2025-06-22T21:34:49.541Z","avatar_url":"https://github.com/maxlen.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Confluence PHP Client\n\nA Confluence RESTful API client in PHP\n\nAn Object Oriented wrapper for Confluence\n\n## Requirements\n\n* PHP \u003e= 7.4.0\n\n## Installation\n\nadd to file composer.json:\n\n```bash\n...\n\"repositories\": [\n  {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/maxlen/confluence-php-client.git\"\n  }\n...\n```\n\nRun in console:\n\n```bash\n\n$ composer require maxlen/confluence-php-client\n```\n\n## Usage\n\n### Authentication\n\n#### Using Personal Access Tokens\n```php\nuse Maxlen\\ConfluenceClient\\ConfluenceClient;\n\n$client = new ConfluenceClient('https://url-to-conluence');\n\n//authenticate with a private access token\n//@see https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html\n$client-\u003eauthenticate('NjU2OTA4NDI2MTY5OkBznOUO8YjaUF7KoOruZRXhILJ9');\n```\n#### Using BaseAuth\n```php\n$client = new ConfluenceClient('https://USERNAME:PASSWORD@url-to-conluence');\n```\nor\n```php\nuse Maxlen\\ConfluenceClient\\ConfluenceClient;\n\n$client = new ConfluenceClient('https://url-to-conluence');\n$client-\u003eauthenticateBasicAuth('USERNAME', 'PASSWORD');\n```\n\n### Fetch pages, comments and attachments\n\n#### Find pages by title and space key\n```php\n/* @var $client Maxlen\\ConfluenceClient\\ConfluenceClient */\n\n\n//Get the page we created\n$searchResults = $client-\u003econtent()-\u003efind([\n    'spaceKey' =\u003e 'testSpaceKey',\n    'title' =\u003e 'Test'\n]);\n\n//first page\n$createdPage = $searchResults-\u003egetResultAt(0);\n```\n\n#### Fetch a page or comment by content id\n```php\n/* @var $client Maxlen\\ConfluenceClient\\ConfluenceClient */\n\n//Get a page or comment\n$resultContent = $client-\u003econtent()-\u003eget(1234567890);\n```\n\n#### Fetch page descendants\n```php\nuse Maxlen\\ConfluenceClient\\Api\\Content;\n/* @var $client Maxlen\\ConfluenceClient\\ConfluenceClient */\n/* @var $page Maxlen\\ConfluenceClient\\Entity\\ContentPage */\n\n//get child content\n$childContent = $client-\u003econtent()-\u003echildren($page, Content::CONTENT_TYPE_PAGE); //\\Maxlen\\ConfluenceClient\\Entity\\ContentSearchResult\n```\n\n### Manipulating  content\n\n#### Create new page\n```php\nuse Maxlen\\ConfluenceClient\\Entity\\ContentPage;\n/* @var $client Maxlen\\ConfluenceClient\\ConfluenceClient */\n\n//Create a confluence content page\n$page = new ContentPage();\n\n//Configure your page\n$page-\u003esetSpace('testSpaceKey')\n    -\u003esetTitle('Test')\n    -\u003esetContent('\u003cp\u003etest page\u003c/p\u003e');\n\n//Create the page in confluence in the test space\n$client-\u003econtent()-\u003ecreate($page);\n```\n\n#### Create new comment\n```php\n/* @var $client Maxlen\\ConfluenceClient\\ConfluenceClient */\n\n//get a page by id\n$page = $client-\u003econtent()-\u003eget(123456789);\n\n//attach a comment to the page\n$comment = $page-\u003ecreateComment('my comment text');\n\n//save the comment\n$client-\u003econtent()-\u003ecreate($comment);\n```\n\n#### Create subpage\n```php\n/* @var $client Maxlen\\ConfluenceClient\\ConfluenceClient */\n\n//get a page by id\n$page = $client-\u003econtent()-\u003eget(123456789);\n\n//attach a subpage to page\n$subPage = $page-\u003ecreateSubpage('subpage title', 'subpage content');\n\n//save the page\n$client-\u003econtent()-\u003ecreate($subPage);\n```\n\n#### Update content\n```php\n/* @var $client Maxlen\\ConfluenceClient\\ConfluenceClient */\n\n//get content by id\n$page = $client-\u003econtent()-\u003eget(123456789);\n\n//change content\n$page-\u003esetContent('new content')\n    -\u003esetTitle('new title');\n\n//save the changes\n$client-\u003econtent()-\u003eupdate($page);\n```\n\n#### Delete content\n```php\n/* @var $client Maxlen\\ConfluenceClient\\ConfluenceClient */\n\n//get content by id\n$page = $client-\u003econtent()-\u003eget(123456789);\n\n//delete content\n$client-\u003econtent()-\u003edelete($page);\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxlen%2Fconfluence-php-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxlen%2Fconfluence-php-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxlen%2Fconfluence-php-client/lists"}