All URIs are relative to https://api.segmentapis.com
Method | HTTP request | Description |
---|---|---|
GetDailyPerSourceAPICallsUsage | Get /usage/api-calls/sources/daily | Get Daily Per Source API Calls Usage |
GetDailyWorkspaceAPICallsUsage | Get /usage/api-calls/daily | Get Daily Workspace API Calls Usage |
GetDailyPerSourceAPICallsUsage200Response GetDailyPerSourceAPICallsUsage(ctx).Period(period).Pagination(pagination).Execute()
Get Daily Per Source API Calls Usage
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
period := "2021-02-01" // string | The start of the usage month in the ISO-8601 format. This parameter exists in v1.
pagination := *api.NewPaginationInput(10) // PaginationInput | Pagination input for per Source API calls counts. This parameter exists in v1. (optional)
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.APICallsAPI.GetDailyPerSourceAPICallsUsage(ctx).Period(period).Pagination(pagination).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `APICallsAPI.GetDailyPerSourceAPICallsUsage``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `GetDailyPerSourceAPICallsUsage`: GetDailyPerSourceAPICallsUsage200Response
fmt.Fprintf(os.Stdout, "Response from `APICallsAPI.GetDailyPerSourceAPICallsUsage`: %v\n", resp.GetData())
}
Other parameters are passed through a pointer to a apiGetDailyPerSourceAPICallsUsageRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
period | string | The start of the usage month in the ISO-8601 format. This parameter exists in v1. | |
pagination | PaginationInput | Pagination input for per Source API calls counts. This parameter exists in v1. |
GetDailyPerSourceAPICallsUsage200Response
- Content-Type: Not defined
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetDailyWorkspaceAPICallsUsage200Response GetDailyWorkspaceAPICallsUsage(ctx).Period(period).Pagination(pagination).Execute()
Get Daily Workspace API Calls Usage
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
period := "2021-02-01" // string | The start of the usage month in the ISO-8601 format. This parameter exists in v1.
pagination := *api.NewPaginationInput(10) // PaginationInput | Pagination input for Workspace API call counts. This parameter exists in v1. (optional)
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.APICallsAPI.GetDailyWorkspaceAPICallsUsage(ctx).Period(period).Pagination(pagination).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `APICallsAPI.GetDailyWorkspaceAPICallsUsage``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `GetDailyWorkspaceAPICallsUsage`: GetDailyWorkspaceAPICallsUsage200Response
fmt.Fprintf(os.Stdout, "Response from `APICallsAPI.GetDailyWorkspaceAPICallsUsage`: %v\n", resp.GetData())
}
Other parameters are passed through a pointer to a apiGetDailyWorkspaceAPICallsUsageRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
period | string | The start of the usage month in the ISO-8601 format. This parameter exists in v1. | |
pagination | PaginationInput | Pagination input for Workspace API call counts. This parameter exists in v1. |
GetDailyWorkspaceAPICallsUsage200Response
- Content-Type: Not defined
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]