GrantsService
A list of all methods in the GrantsService service. Click on the method name to view detailed information about that method.
| Methods | Description |
|---|---|
| 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. |
| getGrantById | Returns the details of a grant. |
| revokeGrant | Revokes 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
| Name | Type | Required | Description |
|---|---|---|---|
| grantId | String | ✅ | The 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
| Name | Type | Required | Description |
|---|---|---|---|
| grantId | String | ✅ | The 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);
}