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
listRequestsReturns a list of requests. Requests are sorted by creation date, descending.
createRequestCreates 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.
getRequestByIdReturns the details of a request.
cancelRequestByIdCancels the specified request.

listRequests

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

import com.swagger.petstore.TestSdk;
import com.swagger.petstore.config.TestSdkConfig;
import com.swagger.petstore.models.Request;
import java.util.List;

public class Main {
public static void main(String[] args) {
TestSdkConfig config = TestSdkConfig.builder()
.accessToken("YOUR_ACCESS_TOKEN")
.build();

TestSdk testSdk = new TestSdk(config);

List<Request> response = testSdk.requests.listRequests();

System.out.println(response);
}
}

createRequest

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
requestParamsRequestParamsRequest Body

Return Type

Request

Example Usage Code Snippet

import com.swagger.petstore.TestSdk;
import com.swagger.petstore.config.TestSdkConfig;
import com.swagger.petstore.models.Request;
import com.swagger.petstore.models.RequestParams;
import com.swagger.petstore.models.UserInput;

public class Main {
public static void main(String[] args) {
TestSdkConfig config = TestSdkConfig.builder()
.accessToken("YOUR_ACCESS_TOKEN")
.build();

TestSdk testSdk = new TestSdk(config);

UserInput userInput = UserInput.builder()
.expireIn("78488667m")
.expireAt("expire_at")
.build();

RequestParams requestParams = RequestParams.builder()
.grantKitId("grant_kit_id")
.reason("reason")
.userInput(userInput)
.build();

Request response = testSdk.requests.createRequest(requestParams);

System.out.println(response);
}
}

getRequestById

Returns the details of a request.

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

Parameters

NameTypeRequiredDescription
requestIdStringThe ID of the request to retrieve

Return Type

Request

Example Usage Code Snippet

import com.swagger.petstore.TestSdk;
import com.swagger.petstore.config.TestSdkConfig;
import com.swagger.petstore.models.Request;

public class Main {
public static void main(String[] args) {
TestSdkConfig config = TestSdkConfig.builder()
.accessToken("YOUR_ACCESS_TOKEN")
.build();

TestSdk testSdk = new TestSdk(config);

Request response = testSdk.requests.getRequestById("request_id");

System.out.println(response);
}
}

cancelRequestById

Cancels the specified request.

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

Parameters

NameTypeRequiredDescription
requestIdStringThe ID of the request to cancel
requestCancelParamsRequestCancelParamsRequest Body

Return Type

Request

Example Usage Code Snippet

import com.swagger.petstore.TestSdk;
import com.swagger.petstore.config.TestSdkConfig;
import com.swagger.petstore.models.Request;
import com.swagger.petstore.models.RequestCancelParams;

public class Main {
public static void main(String[] args) {
TestSdkConfig config = TestSdkConfig.builder()
.accessToken("YOUR_ACCESS_TOKEN")
.build();

TestSdk testSdk = new TestSdk(config);

RequestCancelParams requestCancelParams = RequestCancelParams.builder()
.reason("reason")
.build();

Request response = testSdk.requests.cancelRequestById("request_id", requestCancelParams);

System.out.println(response);
}
}