PHP code example of adesso-mobile / php-confluence-client
1. Go to this page and download the library: Download adesso-mobile/php-confluence-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
adesso-mobile / php-confluence-client example snippets
Configure HTTP basic authorization: crowdAuth
$config = ConfluenceClient\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new ConfluenceClient\Api\ConfluenceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$page_id = 56; // int | The page ID to return information about the page.
$status = 'status_example'; // string | list of Content statuses to filter results on. Default value: [current]
$version = new \stdClass; // object |
$expand = 'history,space,version'; // string | A comma separated list of properties to expand on the content. Default value: history,space,version We can also specify some extensions such as extensions.inlineProperties (for getting inline comment-specific properties) or extensions.resolution for the resolution status of each comment in the results
try {
$result = $apiInstance->getContentById($page_id, $status, $version, $expand);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ConfluenceApi->getContentById: ', $e->getMessage(), PHP_EOL;
}