Skip to content

Latest commit

 

History

History
165 lines (110 loc) · 7.57 KB

File metadata and controls

165 lines (110 loc) · 7.57 KB

Requests

(requests)

Overview

REST APIs for retrieving request information

Available Operations

generateRequestPostmanCollection

Generates a Postman collection for a particular request. Allowing it to be replayed with the same inputs that were captured by the SDK.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;

$security = new Shared\Security(
    apiKey: '<YOUR_API_KEY_HERE>',
);

$sdk = SpeakeasyClientSDK\SDK::builder()->setSecurity($security)->build();

$request = new Operations\GenerateRequestPostmanCollectionRequest(
    requestID: '<id>',
);

$response = $sdk->requests->generateRequestPostmanCollection(
    request: $request
);

if ($response->postmanCollection !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\GenerateRequestPostmanCollectionRequest ✔️ The request object to use for the request.

Response

?Operations\GenerateRequestPostmanCollectionResponse

Errors

Error Type Status Code Content Type
Errorors\Error 4XX application/json
Errorors\SDKException 5XX */*

getRequestFromEventLog

Get information about a particular request.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;

$security = new Shared\Security(
    apiKey: '<YOUR_API_KEY_HERE>',
);

$sdk = SpeakeasyClientSDK\SDK::builder()->setSecurity($security)->build();

$request = new Operations\GetRequestFromEventLogRequest(
    requestID: '<id>',
);

$response = $sdk->requests->getRequestFromEventLog(
    request: $request
);

if ($response->unboundedRequest !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\GetRequestFromEventLogRequest ✔️ The request object to use for the request.

Response

?Operations\GetRequestFromEventLogResponse

Errors

Error Type Status Code Content Type
Errorors\Error 4XX application/json
Errorors\SDKException 5XX */*

queryEventLog

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.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;

$security = new Shared\Security(
    apiKey: '<YOUR_API_KEY_HERE>',
);

$sdk = SpeakeasyClientSDK\SDK::builder()->setSecurity($security)->build();

$request = new Operations\QueryEventLogRequest();

$response = $sdk->requests->queryEventLog(
    request: $request
);

if ($response->boundedRequests !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\QueryEventLogRequest ✔️ The request object to use for the request.

Response

?Operations\QueryEventLogResponse

Errors

Error Type Status Code Content Type
Errorors\Error 4XX application/json
Errorors\SDKException 5XX */*