Skip to main content

RequestsService

A list of all methods in the RequestsService service. Click on the method name to view detailed information about that method.

MethodsDescription
list_requestsReturns a list of requests. Requests are sorted by creation date, descending.
create_requestCreates a new request. You will need to pass in a Grant Kit ID as the target of this request. This will create a request against the latest version of the Grant Kit. Grant Kit Versions are immutable and you won't be able to create a request against an older Grant Kit Version. If you want to do this, you will have to roll forward by creating a new Grant Kit Version.
get_request_by_idReturns the details of a request.
cancel_request_by_idCancels the specified request.

list_requests

Returns a list of requests. Requests are sorted by creation date, descending.

  • HTTP Method: GET
  • Endpoint: /requests

Return Type

List[Request]

Example Usage Code Snippet

from test_sdk import TestSdk

sdk = TestSdk(
access_token="YOUR_ACCESS_TOKEN",
timeout=10000
)

result = sdk.requests.list_requests()

print(result)

create_request

Creates a new request. You will need to pass in a Grant Kit ID as the target of this request. This will create a request against the latest version of the Grant Kit. Grant Kit Versions are immutable and you won't be able to create a request against an older Grant Kit Version. If you want to do this, you will have to roll forward by creating a new Grant Kit Version.

  • HTTP Method: POST
  • Endpoint: /requests

Parameters

NameTypeRequiredDescription
request_bodyRequestParamsThe request body.

Return Type

Request

Example Usage Code Snippet

from test_sdk import TestSdk
from test_sdk.models import RequestParams

sdk = TestSdk(
access_token="YOUR_ACCESS_TOKEN",
timeout=10000
)

request_body = RequestParams(
grant_kit_id="grant_kit_id",
reason="reason",
user_input={
"expire_in": "+159µs",
"expire_at": "expire_at"
}
)

result = sdk.requests.create_request(request_body=request_body)

print(result)

get_request_by_id

Returns the details of a request.

  • HTTP Method: GET
  • Endpoint: /requests/{request_id}

Parameters

NameTypeRequiredDescription
request_idstrThe ID of the request to retrieve

Return Type

Request

Example Usage Code Snippet

from test_sdk import TestSdk

sdk = TestSdk(
access_token="YOUR_ACCESS_TOKEN",
timeout=10000
)

result = sdk.requests.get_request_by_id(request_id="request_id")

print(result)

cancel_request_by_id

Cancels the specified request.

  • HTTP Method: PUT
  • Endpoint: /requests/{request_id}/cancel

Parameters

NameTypeRequiredDescription
request_bodyRequestCancelParamsThe request body.
request_idstrThe ID of the request to cancel

Return Type

Request

Example Usage Code Snippet

from test_sdk import TestSdk
from test_sdk.models import RequestCancelParams

sdk = TestSdk(
access_token="YOUR_ACCESS_TOKEN",
timeout=10000
)

request_body = RequestCancelParams(
reason="reason"
)

result = sdk.requests.cancel_request_by_id(
request_body=request_body,
request_id="request_id"
)

print(result)