PHP code example of muxx / redmine-api-client-php
1. Go to this page and download the library: Download muxx/redmine-api-client-php 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/ */
muxx / redmine-api-client-php example snippets
$c = new Redmine\ApiClient(
new HttpClient(),
new Psr17Factory(),
new Psr17Factory(),
'https://redmine.somehost.com',
'some-api-key'
);
$response = $c->requestGet('projects/some-project/memberships');
foreach ($response['memberships'] as $membership) {
if (isset($membership['user']['name'])) {
echo sprintf("User: %s\n", $membership['user']['name']);
}
if (isset($membership['group']['name'])) {
echo sprintf("Group: %s\n", $membership['group']['name']);
}
}
composer