Skip to main content

GrantsService

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

MethodsDescription
listGrantsReturns a list of all the grants belonging to a user. Grants are sorted by creation date, descending. Creation date effectively means when the grant was approved.
getGrantByIdReturns the details of a grant.
revokeGrantRevokes the specified grant.

listGrants

Returns a list of all the grants belonging to a user. Grants are sorted by creation date, descending. Creation date effectively means when the grant was approved.

  • HTTP Method: GET
  • Endpoint: /grants

Return Type

List<Grant>

Example Usage Code Snippet

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

fun main() {
val config: TestSdkConfig = TestSdkConfig.builder()
.accessToken("YOUR_ACCESS_TOKEN")
.build();

val testSdk: TestSdk = TestSdk(config);

val response: List<Grant> = testSdk.grants.listGrants();

println(response);
}

getGrantById

Returns the details of a grant.

  • HTTP Method: GET
  • Endpoint: /grants/{grant_id}

Parameters

NameTypeRequiredDescription
grantIdStringThe ID of the grant to retrieve

Return Type

Grant

Example Usage Code Snippet

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

fun main() {
val config: TestSdkConfig = TestSdkConfig.builder()
.accessToken("YOUR_ACCESS_TOKEN")
.build();

val testSdk: TestSdk = TestSdk(config);

val response: Grant = testSdk.grants.getGrantById("grant_id");

println(response);
}

revokeGrant

Revokes the specified grant.

  • HTTP Method: DELETE
  • Endpoint: /grants/{grant_id}

Parameters

NameTypeRequiredDescription
grantIdStringThe ID of the grant to revoke

Return Type

Grant

Example Usage Code Snippet

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

fun main() {
val config: TestSdkConfig = TestSdkConfig.builder()
.accessToken("YOUR_ACCESS_TOKEN")
.build();

val testSdk: TestSdk = TestSdk(config);

val response: Grant = testSdk.grants.revokeGrant("grant_id");

println(response);
}