- list - Consumer request counts
Get consumer request counts within a given datetime range.
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: process.env["APIDECK_API_KEY"] ?? "",
});
async function run() {
const result = await apideck.vault.consumerRequestCounts.list({
consumerId: "test_user_id",
startDatetime: "2021-05-01T12:00:00.000Z",
endDatetime: "2021-05-30T12:00:00.000Z",
});
console.log(result);
}
run();The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { vaultConsumerRequestCountsList } from "@apideck/unify/funcs/vaultConsumerRequestCountsList.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: process.env["APIDECK_API_KEY"] ?? "",
});
async function run() {
const res = await vaultConsumerRequestCountsList(apideck, {
consumerId: "test_user_id",
startDatetime: "2021-05-01T12:00:00.000Z",
endDatetime: "2021-05-30T12:00:00.000Z",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultConsumerRequestCountsList failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.VaultConsumerRequestCountsAllRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.VaultConsumerRequestCountsAllResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequestResponse | 400 | application/json |
| errors.UnauthorizedResponse | 401 | application/json |
| errors.PaymentRequiredResponse | 402 | application/json |
| errors.NotFoundResponse | 404 | application/json |
| errors.UnprocessableResponse | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |