(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.
package hello.world;
import dev.speakeasyapi.javaclientsdk.SDK;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.GenerateRequestPostmanCollectionRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.GenerateRequestPostmanCollectionResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
GenerateRequestPostmanCollectionRequest req = GenerateRequestPostmanCollectionRequest.builder()
.requestID("<id>")
.build();
GenerateRequestPostmanCollectionResponse res = sdk.requests().generateRequestPostmanCollection()
.request(req)
.call();
if (res.postmanCollection().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
GenerateRequestPostmanCollectionRequest | ✔️ | The request object to use for the request. |
GenerateRequestPostmanCollectionResponse
Error Type | Status Code | Content Type |
---|---|---|
models/errors/Error | 4XX | application/json |
models/errors/SDKError | 5XX | */* |
Get information about a particular request.
package hello.world;
import dev.speakeasyapi.javaclientsdk.SDK;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.GetRequestFromEventLogRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.GetRequestFromEventLogResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
GetRequestFromEventLogRequest req = GetRequestFromEventLogRequest.builder()
.requestID("<id>")
.build();
GetRequestFromEventLogResponse res = sdk.requests().getRequestFromEventLog()
.request(req)
.call();
if (res.unboundedRequest().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
GetRequestFromEventLogRequest | ✔️ | The request object to use for the request. |
GetRequestFromEventLogResponse
Error Type | Status Code | Content Type |
---|---|---|
models/errors/Error | 4XX | application/json |
models/errors/SDKError | 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.
package hello.world;
import dev.speakeasyapi.javaclientsdk.SDK;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.QueryEventLogRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.QueryEventLogResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
QueryEventLogRequest req = QueryEventLogRequest.builder()
.build();
QueryEventLogResponse res = sdk.requests().queryEventLog()
.request(req)
.call();
if (res.boundedRequests().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
QueryEventLogRequest | ✔️ | The request object to use for the request. |
Error Type | Status Code | Content Type |
---|---|---|
models/errors/Error | 4XX | application/json |
models/errors/SDKError | 5XX | */* |