OAuth2API

export declare class OAuth2API
export declare class OAuth2API

No summary provided.

constructor(rest)
Constructs a new instance of the OAuth2API class
NameTypeOptionalDescription
restRESTNoNone
generateAuthorizationURL(options):string
NameTypeOptionalDescription
optionsRESTOAuth2AuthorizationQueryNo
The options for creating the authorization URL
getCurrentAuthorizationInformation(options?):Promise<RESTGetAPIOAuth2CurrentAuthorizationResult>
NameTypeOptionalDescription
optionsPick<RequestData, 'auth' | 'signal'>Yes
The options for the current authorization information request
getCurrentBotApplicationInformation(options?):Promise<RESTGetAPIOAuth2CurrentApplicationResult>
NameTypeOptionalDescription
optionsPick<RequestData, 'auth' | 'signal'>Yes
The options for the current bot application information request
Fetches the bearer token for the current application
Remarks
This is primarily used for testing purposes
NameTypeOptionalDescription
bodyRESTPostOAuth2ClientCredentialsURLEncodedDataNo
The options for the client credentials grant request
optionsPick<RequestData, 'signal'>Yes
The options for the client credentials grant request
refreshToken(body, options?):Promise<RESTPostOAuth2AccessTokenResult>
NameTypeOptionalDescription
bodyRESTPostOAuth2RefreshTokenURLEncodedDataNo
The options for the refresh token request
optionsPick<RequestData, 'signal'>Yes
The options for the refresh token request
revokeToken(applicationId, applicationSecret, body, options?):Promise<void>
NameTypeOptionalDescription
applicationIdSnowflakeNo
The application id
applicationSecretstringNo
The application secret
bodyRESTPostOAuth2TokenRevocationQueryNo
The body of the token revocation request
optionsPick<RequestData, 'signal'>Yes
The options for the token revocation request
tokenExchange(body, options?):Promise<RESTPostOAuth2AccessTokenResult>
NameTypeOptionalDescription
bodyRESTPostOAuth2AccessTokenURLEncodedDataNo
The body of the token exchange request
optionsPick<RequestData, 'signal'>Yes
The options for the token exchange request