(Auth)
REST APIs for managing Authentication
- GetAccessToken - Get or refresh an access token for the current workspace.
- GetUser - Get information about the current user.
- GetWorkspaceAccess - Get access allowances for a particular workspace
- ValidateApiKey - Validate the current api key.
Get or refresh an access token for the current workspace.
using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;
var sdk = new SDK();
GetAccessTokenRequest req = new GetAccessTokenRequest() {
WorkspaceId = "<value>",
};
var res = await sdk.Auth.GetAccessTokenAsync(req);
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
request |
GetAccessTokenRequest | ✔️ | The request object to use for the request. |
Error Object | Status Code | Content Type |
---|---|---|
SpeakeasySDK.Models.Errors.SDKException | 4xx-5xx | / |
Get information about the current user.
using SpeakeasySDK;
using SpeakeasySDK.Models.Shared;
var sdk = new SDK(security: new Security() {
APIKey = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Auth.GetUserAsync();
// handle response
Error Object | Status Code | Content Type |
---|---|---|
SpeakeasySDK.Models.Errors.SDKException | 4xx-5xx | / |
Checks if generation is permitted for a particular run of the CLI
using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;
var sdk = new SDK(security: new Security() {
APIKey = "<YOUR_API_KEY_HERE>",
});
GetWorkspaceAccessRequest req = new GetWorkspaceAccessRequest() {};
var res = await sdk.Auth.GetWorkspaceAccessAsync(req);
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
request |
GetWorkspaceAccessRequest | ✔️ | The request object to use for the request. |
Error Object | Status Code | Content Type |
---|---|---|
SpeakeasySDK.Models.Errors.SDKException | 4xx-5xx | / |
Validate the current api key.
using SpeakeasySDK;
using SpeakeasySDK.Models.Shared;
var sdk = new SDK(security: new Security() {
APIKey = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Auth.ValidateApiKeyAsync();
// handle response
Error Object | Status Code | Content Type |
---|---|---|
SpeakeasySDK.Models.Errors.SDKException | 4xx-5xx | / |