|
| 1 | +# segment_public_api.APICallsApi |
| 2 | + |
| 3 | +All URIs are relative to *https://api.segmentapis.com* |
| 4 | + |
| 5 | +Method | HTTP request | Description |
| 6 | +------------- | ------------- | ------------- |
| 7 | +[**get_daily_per_source_api_calls_usage**](APICallsApi.md#get_daily_per_source_api_calls_usage) | **GET** /usage/api-calls/sources/daily | Get Daily Per Source API Calls Usage |
| 8 | +[**get_daily_workspace_api_calls_usage**](APICallsApi.md#get_daily_workspace_api_calls_usage) | **GET** /usage/api-calls/daily | Get Daily Workspace API Calls Usage |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +## Operation: get_daily_per_source_api_calls_usage |
| 13 | + |
| 14 | +> GetDailyPerSourceAPICallsUsage200Response get_daily_per_source_api_calls_usage(period, pagination) |
| 15 | +
|
| 16 | +Get Daily Per Source API Calls Usage |
| 17 | + |
| 18 | +Provides daily cumulative per-source API call counts for a usage period. |
| 19 | + |
| 20 | +### Example |
| 21 | + |
| 22 | +* Bearer Authentication (token): |
| 23 | +```python |
| 24 | +import time |
| 25 | +import os |
| 26 | +import segment_public_api |
| 27 | +from segment_public_api.models.get_daily_per_source_api_calls_usage200_response import GetDailyPerSourceAPICallsUsage200Response |
| 28 | +from segment_public_api.models.pagination_input import PaginationInput |
| 29 | +from segment_public_api.rest import ApiException |
| 30 | +from pprint import pprint |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +# Configure Bearer authorization: token |
| 35 | +configuration = segment_public_api.Configuration( |
| 36 | + access_token = os.environ["BEARER_TOKEN"] |
| 37 | +) |
| 38 | + |
| 39 | +# Enter a context with an instance of the API client |
| 40 | +with segment_public_api.ApiClient(configuration) as api_client: |
| 41 | + # Create an instance of the API class |
| 42 | + api_instance = segment_public_api.APICallsApi(api_client) |
| 43 | + period = '2021-02-01' # str | The start of the usage month in the ISO-8601 format. This parameter exists in v1. |
| 44 | + pagination = segment_public_api.PaginationInput(count=10) # PaginationInput | Pagination input for per Source API calls counts. This parameter exists in v1. |
| 45 | + |
| 46 | + try: |
| 47 | + # Get Daily Per Source API Calls Usage |
| 48 | + api_response = api_instance.get_daily_per_source_api_calls_usage(period, pagination) |
| 49 | + print("The response of APICallsApi->get_daily_per_source_api_calls_usage:\n") |
| 50 | + pprint(api_response) |
| 51 | + except Exception as e: |
| 52 | + print("Exception when calling APICallsApi->get_daily_per_source_api_calls_usage: %s\n" % e) |
| 53 | +``` |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | +### Parameters |
| 58 | + |
| 59 | +Name | Type | Description | Notes |
| 60 | +------------- | ------------- | ------------- | ------------- |
| 61 | + **period** | **str**| The start of the usage month in the ISO-8601 format. This parameter exists in v1. | |
| 62 | + **pagination** | [**PaginationInput**](.md)| Pagination input for per Source API calls counts. This parameter exists in v1. | |
| 63 | + |
| 64 | +### Return type |
| 65 | + |
| 66 | +[**GetDailyPerSourceAPICallsUsage200Response**](GetDailyPerSourceAPICallsUsage200Response.md) |
| 67 | + |
| 68 | +### Authorization |
| 69 | + |
| 70 | +[token](../README.md#token) |
| 71 | + |
| 72 | +### HTTP request headers |
| 73 | + |
| 74 | + - **Content-Type**: Not defined |
| 75 | + - **Accept**: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json |
| 76 | + |
| 77 | +### HTTP response details |
| 78 | +| Status code | Description | Response headers | |
| 79 | +|-------------|-------------|------------------| |
| 80 | +**200** | OK | - | |
| 81 | +**404** | Resource not found | - | |
| 82 | +**422** | Validation failure | - | |
| 83 | +**429** | Too many requests | - | |
| 84 | + |
| 85 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 86 | + |
| 87 | + |
| 88 | +## Operation: get_daily_workspace_api_calls_usage |
| 89 | + |
| 90 | +> GetDailyWorkspaceAPICallsUsage200Response get_daily_workspace_api_calls_usage(period, pagination) |
| 91 | +
|
| 92 | +Get Daily Workspace API Calls Usage |
| 93 | + |
| 94 | +Provides daily cumulative API call counts for a usage period. |
| 95 | + |
| 96 | +### Example |
| 97 | + |
| 98 | +* Bearer Authentication (token): |
| 99 | +```python |
| 100 | +import time |
| 101 | +import os |
| 102 | +import segment_public_api |
| 103 | +from segment_public_api.models.get_daily_workspace_api_calls_usage200_response import GetDailyWorkspaceAPICallsUsage200Response |
| 104 | +from segment_public_api.models.pagination_input import PaginationInput |
| 105 | +from segment_public_api.rest import ApiException |
| 106 | +from pprint import pprint |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | +# Configure Bearer authorization: token |
| 111 | +configuration = segment_public_api.Configuration( |
| 112 | + access_token = os.environ["BEARER_TOKEN"] |
| 113 | +) |
| 114 | + |
| 115 | +# Enter a context with an instance of the API client |
| 116 | +with segment_public_api.ApiClient(configuration) as api_client: |
| 117 | + # Create an instance of the API class |
| 118 | + api_instance = segment_public_api.APICallsApi(api_client) |
| 119 | + period = '2021-02-01' # str | The start of the usage month in the ISO-8601 format. This parameter exists in v1. |
| 120 | + pagination = segment_public_api.PaginationInput(count=10) # PaginationInput | Pagination input for Workspace API call counts. This parameter exists in v1. |
| 121 | + |
| 122 | + try: |
| 123 | + # Get Daily Workspace API Calls Usage |
| 124 | + api_response = api_instance.get_daily_workspace_api_calls_usage(period, pagination) |
| 125 | + print("The response of APICallsApi->get_daily_workspace_api_calls_usage:\n") |
| 126 | + pprint(api_response) |
| 127 | + except Exception as e: |
| 128 | + print("Exception when calling APICallsApi->get_daily_workspace_api_calls_usage: %s\n" % e) |
| 129 | +``` |
| 130 | + |
| 131 | + |
| 132 | + |
| 133 | +### Parameters |
| 134 | + |
| 135 | +Name | Type | Description | Notes |
| 136 | +------------- | ------------- | ------------- | ------------- |
| 137 | + **period** | **str**| The start of the usage month in the ISO-8601 format. This parameter exists in v1. | |
| 138 | + **pagination** | [**PaginationInput**](.md)| Pagination input for Workspace API call counts. This parameter exists in v1. | |
| 139 | + |
| 140 | +### Return type |
| 141 | + |
| 142 | +[**GetDailyWorkspaceAPICallsUsage200Response**](GetDailyWorkspaceAPICallsUsage200Response.md) |
| 143 | + |
| 144 | +### Authorization |
| 145 | + |
| 146 | +[token](../README.md#token) |
| 147 | + |
| 148 | +### HTTP request headers |
| 149 | + |
| 150 | + - **Content-Type**: Not defined |
| 151 | + - **Accept**: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json |
| 152 | + |
| 153 | +### HTTP response details |
| 154 | +| Status code | Description | Response headers | |
| 155 | +|-------------|-------------|------------------| |
| 156 | +**200** | OK | - | |
| 157 | +**404** | Resource not found | - | |
| 158 | +**422** | Validation failure | - | |
| 159 | +**429** | Too many requests | - | |
| 160 | + |
| 161 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 162 | + |
0 commit comments