|
| 1 | +# OpenAPI\Client\AnalyticsApi |
| 2 | + |
| 3 | +All URIs are relative to https://api.builtbybit.com, except if the operation defines another base path. |
| 4 | + |
| 5 | +| Method | HTTP request | Description | |
| 6 | +| ------------- | ------------- | ------------- | |
| 7 | +| [**getV2Analytics()**](AnalyticsApi.md#getV2Analytics) | **GET** /v2/analytics | Fetch a list of analytics definitions | |
| 8 | +| [**getV2AnalyticsGraph()**](AnalyticsApi.md#getV2AnalyticsGraph) | **GET** /v2/analytics/graph | Fetch analytics graph data | |
| 9 | +| [**getV2AnalyticsSingle()**](AnalyticsApi.md#getV2AnalyticsSingle) | **GET** /v2/analytics/single | Fetch a single analytics value | |
| 10 | + |
| 11 | + |
| 12 | +## `getV2Analytics()` |
| 13 | + |
| 14 | +```php |
| 15 | +getV2Analytics(): \OpenAPI\Client\Model\GetV2Analytics200Response |
| 16 | +``` |
| 17 | + |
| 18 | +Fetch a list of analytics definitions |
| 19 | + |
| 20 | +### Example |
| 21 | + |
| 22 | +```php |
| 23 | +<?php |
| 24 | +require_once(__DIR__ . '/vendor/autoload.php'); |
| 25 | + |
| 26 | + |
| 27 | +// Configure API key authorization: token |
| 28 | +$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); |
| 29 | +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 30 | +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); |
| 31 | + |
| 32 | + |
| 33 | +$apiInstance = new OpenAPI\Client\Api\AnalyticsApi( |
| 34 | + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. |
| 35 | + // This is optional, `GuzzleHttp\Client` will be used as default. |
| 36 | + new GuzzleHttp\Client(), |
| 37 | + $config |
| 38 | +); |
| 39 | + |
| 40 | +try { |
| 41 | + $result = $apiInstance->getV2Analytics(); |
| 42 | + print_r($result); |
| 43 | +} catch (Exception $e) { |
| 44 | + echo 'Exception when calling AnalyticsApi->getV2Analytics: ', $e->getMessage(), PHP_EOL; |
| 45 | +} |
| 46 | +``` |
| 47 | + |
| 48 | +### Parameters |
| 49 | + |
| 50 | +This endpoint does not need any parameter. |
| 51 | + |
| 52 | +### Return type |
| 53 | + |
| 54 | +[**\OpenAPI\Client\Model\GetV2Analytics200Response**](../Model/GetV2Analytics200Response.md) |
| 55 | + |
| 56 | +### Authorization |
| 57 | + |
| 58 | +[token](../../README.md#token) |
| 59 | + |
| 60 | +### HTTP request headers |
| 61 | + |
| 62 | +- **Content-Type**: Not defined |
| 63 | +- **Accept**: `application/json` |
| 64 | + |
| 65 | +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) |
| 66 | +[[Back to Model list]](../../README.md#models) |
| 67 | +[[Back to README]](../../README.md) |
| 68 | + |
| 69 | +## `getV2AnalyticsGraph()` |
| 70 | + |
| 71 | +```php |
| 72 | +getV2AnalyticsGraph($analytics, $period, $filters, $start_date, $end_date): \OpenAPI\Client\Model\GetV2AnalyticsGraph200Response |
| 73 | +``` |
| 74 | + |
| 75 | +Fetch analytics graph data |
| 76 | + |
| 77 | +### Example |
| 78 | + |
| 79 | +```php |
| 80 | +<?php |
| 81 | +require_once(__DIR__ . '/vendor/autoload.php'); |
| 82 | + |
| 83 | + |
| 84 | +// Configure API key authorization: token |
| 85 | +$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); |
| 86 | +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 87 | +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); |
| 88 | + |
| 89 | + |
| 90 | +$apiInstance = new OpenAPI\Client\Api\AnalyticsApi( |
| 91 | + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. |
| 92 | + // This is optional, `GuzzleHttp\Client` will be used as default. |
| 93 | + new GuzzleHttp\Client(), |
| 94 | + $config |
| 95 | +); |
| 96 | +$analytics = NULL; // array | A list of analytic IDs to fetch data for. |
| 97 | +$period = 'period_example'; // string | The time period to fetch data over. |
| 98 | +$filters = NULL; // array | A set of filters which may be used for the analytics. |
| 99 | +$start_date = 'start_date_example'; // string | Only respected when 'period' = 'custom_range', in the format 'YYYY-MM-DD'. |
| 100 | +$end_date = 'end_date_example'; // string | Only respected when 'period' = 'custom_range', in the format 'YYYY-MM-DD'. |
| 101 | + |
| 102 | +try { |
| 103 | + $result = $apiInstance->getV2AnalyticsGraph($analytics, $period, $filters, $start_date, $end_date); |
| 104 | + print_r($result); |
| 105 | +} catch (Exception $e) { |
| 106 | + echo 'Exception when calling AnalyticsApi->getV2AnalyticsGraph: ', $e->getMessage(), PHP_EOL; |
| 107 | +} |
| 108 | +``` |
| 109 | + |
| 110 | +### Parameters |
| 111 | + |
| 112 | +| Name | Type | Description | Notes | |
| 113 | +| ------------- | ------------- | ------------- | ------------- | |
| 114 | +| **analytics** | [**array**](../Model/.md)| A list of analytic IDs to fetch data for. | [optional] | |
| 115 | +| **period** | **string**| The time period to fetch data over. | [optional] | |
| 116 | +| **filters** | [**array**](../Model/.md)| A set of filters which may be used for the analytics. | [optional] | |
| 117 | +| **start_date** | **string**| Only respected when 'period' = 'custom_range', in the format 'YYYY-MM-DD'. | [optional] | |
| 118 | +| **end_date** | **string**| Only respected when 'period' = 'custom_range', in the format 'YYYY-MM-DD'. | [optional] | |
| 119 | + |
| 120 | +### Return type |
| 121 | + |
| 122 | +[**\OpenAPI\Client\Model\GetV2AnalyticsGraph200Response**](../Model/GetV2AnalyticsGraph200Response.md) |
| 123 | + |
| 124 | +### Authorization |
| 125 | + |
| 126 | +[token](../../README.md#token) |
| 127 | + |
| 128 | +### HTTP request headers |
| 129 | + |
| 130 | +- **Content-Type**: Not defined |
| 131 | +- **Accept**: `application/json` |
| 132 | + |
| 133 | +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) |
| 134 | +[[Back to Model list]](../../README.md#models) |
| 135 | +[[Back to README]](../../README.md) |
| 136 | + |
| 137 | +## `getV2AnalyticsSingle()` |
| 138 | + |
| 139 | +```php |
| 140 | +getV2AnalyticsSingle($analytics, $period, $filters, $start_date, $end_date): \OpenAPI\Client\Model\GetV2AnalyticsSingle200Response |
| 141 | +``` |
| 142 | + |
| 143 | +Fetch a single analytics value |
| 144 | + |
| 145 | +### Example |
| 146 | + |
| 147 | +```php |
| 148 | +<?php |
| 149 | +require_once(__DIR__ . '/vendor/autoload.php'); |
| 150 | + |
| 151 | + |
| 152 | +// Configure API key authorization: token |
| 153 | +$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); |
| 154 | +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 155 | +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); |
| 156 | + |
| 157 | + |
| 158 | +$apiInstance = new OpenAPI\Client\Api\AnalyticsApi( |
| 159 | + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. |
| 160 | + // This is optional, `GuzzleHttp\Client` will be used as default. |
| 161 | + new GuzzleHttp\Client(), |
| 162 | + $config |
| 163 | +); |
| 164 | +$analytics = NULL; // array | A list of analytic IDs to fetch data for. |
| 165 | +$period = 'period_example'; // string | The time period to fetch data over. |
| 166 | +$filters = NULL; // array | A set of filters which may be used for the analytics. |
| 167 | +$start_date = 'start_date_example'; // string | Only respected when 'period' = 'custom_range', in the format 'YYYY-MM-DD'. |
| 168 | +$end_date = 'end_date_example'; // string | Only respected when 'period' = 'custom_range', in the format 'YYYY-MM-DD'. |
| 169 | + |
| 170 | +try { |
| 171 | + $result = $apiInstance->getV2AnalyticsSingle($analytics, $period, $filters, $start_date, $end_date); |
| 172 | + print_r($result); |
| 173 | +} catch (Exception $e) { |
| 174 | + echo 'Exception when calling AnalyticsApi->getV2AnalyticsSingle: ', $e->getMessage(), PHP_EOL; |
| 175 | +} |
| 176 | +``` |
| 177 | + |
| 178 | +### Parameters |
| 179 | + |
| 180 | +| Name | Type | Description | Notes | |
| 181 | +| ------------- | ------------- | ------------- | ------------- | |
| 182 | +| **analytics** | [**array**](../Model/.md)| A list of analytic IDs to fetch data for. | [optional] | |
| 183 | +| **period** | **string**| The time period to fetch data over. | [optional] | |
| 184 | +| **filters** | [**array**](../Model/.md)| A set of filters which may be used for the analytics. | [optional] | |
| 185 | +| **start_date** | **string**| Only respected when 'period' = 'custom_range', in the format 'YYYY-MM-DD'. | [optional] | |
| 186 | +| **end_date** | **string**| Only respected when 'period' = 'custom_range', in the format 'YYYY-MM-DD'. | [optional] | |
| 187 | + |
| 188 | +### Return type |
| 189 | + |
| 190 | +[**\OpenAPI\Client\Model\GetV2AnalyticsSingle200Response**](../Model/GetV2AnalyticsSingle200Response.md) |
| 191 | + |
| 192 | +### Authorization |
| 193 | + |
| 194 | +[token](../../README.md#token) |
| 195 | + |
| 196 | +### HTTP request headers |
| 197 | + |
| 198 | +- **Content-Type**: Not defined |
| 199 | +- **Accept**: `application/json` |
| 200 | + |
| 201 | +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) |
| 202 | +[[Back to Model list]](../../README.md#models) |
| 203 | +[[Back to README]](../../README.md) |
0 commit comments