Skip to content

Commit 9028ea0

Browse files
committed
Updated readme with better example code
1 parent 3478d87 commit 9028ea0

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

README.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,19 @@ require_once(__DIR__ . '/vendor/autoload.php');
6060
// Configure HTTP basic authorization: APP_NORMAL
6161
$config = RusticiSoftware\Cloud\V2\Configuration::getDefaultConfiguration()
6262
->setUsername('YOUR_USERNAME')
63-
->setPassword('YOUR_PASSWORD');
64-
// Configure OAuth2 access token for authorization: OAUTH
65-
$config = RusticiSoftware\Cloud\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
66-
67-
$apiInstance = new RusticiSoftware\Cloud\V2\Api\ApplicationManagementApi(
68-
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
69-
// This is optional, `GuzzleHttp\Client` will be used as default.
70-
new GuzzleHttp\Client(),
71-
$config
72-
);
73-
$application_name = "application_name_example"; // string |
63+
->setPassword('YOUR_PASSWORD')
64+
->setAccessToken(null);
65+
// Alternatively configure OAuth2 access token for authorization: OAUTH
66+
// $config = RusticiSoftware\Cloud\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
67+
68+
$pingInstance = new RusticiSoftware\Cloud\V2\Api\PingApi(null, $config, null);
7469

7570
try {
76-
$result = $apiInstance->createApplication($application_name);
71+
$result = $pingInstance->pingAppId();
7772
print_r($result);
7873
} catch (Exception $e) {
79-
echo 'Exception when calling ApplicationManagementApi->createApplication: ', $e->getMessage(), PHP_EOL;
74+
echo $e->getMessage();
8075
}
81-
8276
?>
8377
```
8478

0 commit comments

Comments
 (0)