Skip to content

Latest commit

 

History

History
137 lines (86 loc) · 4.18 KB

File metadata and controls

137 lines (86 loc) · 4.18 KB

Requests

Overview

REST APIs for retrieving request information

Available Operations

  • query - Query the event log to retrieve a list of requests.
  • get - Get information about a particular request.
  • generate_postman_collection - Generate a Postman collection for a particular request.

query

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

require 'speakeasy_client_sdk_ruby'


s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
  ::OpenApiSDK::Shared::Security.new(
    api_key: "<YOUR_API_KEY_HERE>",
  )
)

    
res = s.requests.query(filters=::OpenApiSDK::Shared::Filters.new(
  filters: [
    ::OpenApiSDK::Shared::Filter.new(
      key: "<key>",
      operator: "<value>",
      value: "<value>",
    ),
  ],
  limit: 764604,
  offset: 989836,
  operator: "<value>",
))

if ! res.bounded_requests.nil?
  # handle response
end

Parameters

Parameter Type Required Description
filters T.nilable(::OpenApiSDK::Shared::Filters) The filter to apply to the query.

Response

T.nilable(::OpenApiSDK::Operations::QueryEventLogResponse)

get

Get information about a particular request.

Example Usage

require 'speakeasy_client_sdk_ruby'


s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
  ::OpenApiSDK::Shared::Security.new(
    api_key: "<YOUR_API_KEY_HERE>",
  )
)

    
res = s.requests.get(request_id="<id>")

if ! res.unbounded_request.nil?
  # handle response
end

Parameters

Parameter Type Required Description
request_id ::String ✔️ The ID of the request to retrieve.

Response

T.nilable(::OpenApiSDK::Operations::GetRequestFromEventLogResponse)

generate_postman_collection

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

require 'speakeasy_client_sdk_ruby'


s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
  ::OpenApiSDK::Shared::Security.new(
    api_key: "<YOUR_API_KEY_HERE>",
  )
)

    
res = s.requests.generate_postman_collection(request_id="<id>")

if ! res.postman_collection.nil?
  # handle response
end

Parameters

Parameter Type Required Description
request_id ::String ✔️ The ID of the request to retrieve.

Response

T.nilable(::OpenApiSDK::Operations::GenerateRequestPostmanCollectionResponse)