Skip to content

Commit fa45d5c

Browse files
committed
Added example
1 parent 64c8e26 commit fa45d5c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

examples/projects.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
require_once __DIR__ . '/vendor/autoload.php';
4+
5+
$client = new \ClientAPI\Semaphore\Semaphore(
6+
// Obtain the Semaphore API key: https://docs.semaphoreui.com/administration-guide/api/
7+
host: 'http://localhost:3000/api',
8+
apiKey: 'ptl1q...........................-p6_ekm=',
9+
);
10+
11+
// Extra configuration
12+
$client->config()->setDebugFile('output.txt');
13+
14+
// Projects
15+
$projects = $client->projects();
16+
17+
try {
18+
$result = $projects->projectsGet();
19+
print_r($result);
20+
} catch (Exception $e) {
21+
echo 'Exception when calling ProjectsApi->projectsGet: ', $e->getMessage(), PHP_EOL;
22+
}

0 commit comments

Comments
 (0)