Skip to content

Commit 4a8edc0

Browse files
authored
Merge pull request #14 from dant89/update-readme
Update readme examples
2 parents 800d394 + 6ef6cd7 commit 4a8edc0

File tree

1 file changed

+35
-9
lines changed

1 file changed

+35
-9
lines changed

README.md

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,51 @@ With the bearer token set, you can return data from all endpoints that require a
4242
```php
4343
// Query for products
4444
$response = $client->getHttpClient(HttpClientType::PRODUCT_OFFERINGS)
45-
->getProductOfferingss();
45+
->get();
4646

4747
// Check for valid response and set the array of products
4848
if ($response->getStatus() === 200) {
4949
$productOfferings = $response->getContent();
5050
}
5151
````
52-
**Get Connections Statistical Timeseries Data:**
52+
53+
**Method Support and Filters:**
54+
55+
All base clients have support for `get`, `delete`, `post`, `patch`.
56+
57+
Additional methods are available where supported, for example `getStatistics`, `getLoa`.
58+
5359
```php
54-
// Query for connections timeseries data
55-
$response = $client->getHttpClient(HttpClientType::CONNECTIONS)
56-
->getStatisticTimeseries('connection-123-uuid', '30d');
60+
$singleItem = $client->getHttpClient(HttpClientType::CONTACTS)
61+
->get('item-uuid')
62+
->getContent();
63+
64+
$filteredItems = $client->getHttpClient(HttpClientType::CONTACTS)
65+
->get(null, ['managing_account' => 'uuid-123'])
66+
->getContent();
67+
68+
$response = $client->getHttpClient(HttpClientType::CONTACTS)
69+
->post([
70+
'managing_account' => 'uuid-123',
71+
'consuming_account' => 'uuid-456',
72+
'name' => 'sample contact',
73+
]);
74+
75+
$client->getHttpClient(HttpClientType::CONTACTS)
76+
->patch('item-uuid', [
77+
'name' => 'renamed sample contact',
78+
]);
79+
80+
$client->getHttpClient(HttpClientType::CONTACTS)
81+
->delete('item-uuid');
5782

58-
// Check for valid response and set the array of products
59-
if ($response->getStatus() === 200) {
60-
$timeseries = $response->getContent();
61-
}
83+
// Query for connections timeseries data
84+
$timeseries = $client->getHttpClient(HttpClientType::CONNECTIONS)
85+
->getStatisticTimeseries('connection-123-uuid', '30d')
86+
->getContent();
6287
````
6388

89+
6490
## Authentication
6591

6692
You will need to contact an exchange to create an API key / secret combination and find out the URL of their IX-API implementation.

0 commit comments

Comments
 (0)