(TokensV1)
Create a new organization token.
using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;
var sdk = new HathoraCloudSDK(
security: new Security() {
HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
},
appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");
CreateOrgTokenRequest req = new CreateOrgTokenRequest() {
CreateOrgToken = new CreateOrgToken() {
Name = "ci-token",
},
OrgId = "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39",
};
using(var res = await sdk.TokensV1.CreateOrgTokenAsync(req))
{
// handle response
}
Parameter |
Type |
Required |
Description |
request |
CreateOrgTokenRequest |
✔️ |
The request object to use for the request. |
CreateOrgTokenResponse
Error Object |
Status Code |
Content Type |
HathoraCloud.Models.Errors.ApiError |
401,404,422,429 |
application/json |
HathoraCloud.Models.Errors.SDKException |
4xx-5xx |
/ |
List all organization tokens for a given org.
using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;
var sdk = new HathoraCloudSDK(
security: new Security() {
HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
},
appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");
GetOrgTokensRequest req = new GetOrgTokensRequest() {
OrgId = "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39",
};
using(var res = await sdk.TokensV1.GetOrgTokensAsync(req))
{
// handle response
}
Parameter |
Type |
Required |
Description |
request |
GetOrgTokensRequest |
✔️ |
The request object to use for the request. |
GetOrgTokensResponse
Error Object |
Status Code |
Content Type |
HathoraCloud.Models.Errors.ApiError |
401,404,429 |
application/json |
HathoraCloud.Models.Errors.SDKException |
4xx-5xx |
/ |
Revoke an organization token.
using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;
var sdk = new HathoraCloudSDK(
security: new Security() {
HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
},
appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");
RevokeOrgTokenRequest req = new RevokeOrgTokenRequest() {
OrgId = "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39",
OrgTokenId = "org-token-af469a92-5b45-4565-b3c4-b79878de67d2",
};
using(var res = await sdk.TokensV1.RevokeOrgTokenAsync(req))
{
// handle response
}
Parameter |
Type |
Required |
Description |
request |
RevokeOrgTokenRequest |
✔️ |
The request object to use for the request. |
RevokeOrgTokenResponse
Error Object |
Status Code |
Content Type |
HathoraCloud.Models.Errors.ApiError |
401,404,429 |
application/json |
HathoraCloud.Models.Errors.SDKException |
4xx-5xx |
/ |