(requests)
REST APIs for retrieving request information
- generateRequestPostmanCollection - Generate a Postman collection for a particular request.
- getRequestFromEventLog - Get information about a particular request.
- queryEventLog - Query the event log to retrieve a list of requests.
Generates a Postman collection for a particular request. Allowing it to be replayed with the same inputs that were captured by the SDK.
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
async function run() {
const sdk = new Speakeasy({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
const res = await sdk.requests.generateRequestPostmanCollection({
requestID: "<value>",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GenerateRequestPostmanCollectionRequest | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GenerateRequestPostmanCollectionResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Get information about a particular request.
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
async function run() {
const sdk = new Speakeasy({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
const res = await sdk.requests.getRequestFromEventLog({
requestID: "<value>",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetRequestFromEventLogRequest | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetRequestFromEventLogResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Supports retrieving a list of request captured by the SDK for this workspace. Allows the filtering of requests on a number of criteria such as ApiID, VersionID, Path, Method, etc.
import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
async function run() {
const sdk = new Speakeasy({
security: {
apiKey: "<YOUR_API_KEY_HERE>",
},
});
const res = await sdk.requests.queryEventLog({
filters: {
filters: [
{
key: "<key>",
operator: "<value>",
value: "<value>",
},
],
limit: 241978,
offset: 451388,
operator: "<value>",
},
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.QueryEventLogRequest | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.QueryEventLogResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |