(Vault.ConsumerRequestCounts)
- List - Consumer request counts
Get consumer request counts within a given datetime range.
package main
import(
"context"
"os"
sdkgo "github.com/apideck-libraries/sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := sdkgo.New(
sdkgo.WithSecurity(os.Getenv("APIDECK_API_KEY")),
sdkgo.WithConsumerID("test-consumer"),
sdkgo.WithAppID("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"),
)
res, err := s.Vault.ConsumerRequestCounts.List(ctx, "test_user_id", "2021-05-01T12:00:00.000Z", "2021-05-30T12:00:00.000Z", nil)
if err != nil {
log.Fatal(err)
}
if res.ConsumerRequestCountsInDateRangeResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
consumerID |
string | ✔️ | ID of the consumer to return | test_user_id |
startDatetime |
string | ✔️ | Scopes results to requests that happened after datetime | 2021-05-01T12:00:00.000Z |
endDatetime |
string | ✔️ | Scopes results to requests that happened before datetime | 2021-05-30T12:00:00.000Z |
appID |
*string | ➖ | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.VaultConsumerRequestCountsAllResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.BadRequestResponse | 400 | application/json |
apierrors.UnauthorizedResponse | 401 | application/json |
apierrors.PaymentRequiredResponse | 402 | application/json |
apierrors.NotFoundResponse | 404 | application/json |
apierrors.UnprocessableResponse | 422 | application/json |
apierrors.APIError | 4XX, 5XX | */* |