(RoomsV2 )
Create a new room for an existing application . Poll the GetConnectionInfo()
endpoint to get connection details for an active room.
using HathoraCloud ;
using HathoraCloud . Models . Shared ;
using HathoraCloud . Models . Operations ;
using System . Collections . Generic ;
var sdk = new HathoraCloudSDK (
security : new Security ( ) {
HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>" ,
} ,
appId : "app-af469a92-5b45-4565-b3c4-b79878de67d2" ) ;
CreateRoomRequest req = new CreateRoomRequest ( ) {
CreateRoomParams = new CreateRoomParams ( ) {
Region = Region . SaoPaulo ,
RoomConfig = "{\" name\" :\" my-room\" }" ,
} ,
RoomId = "2swovpy1fnunu" ,
} ;
using ( var res = await sdk . RoomsV2 . CreateRoomAsync ( req ) )
{
// handle response
}
Parameter
Type
Required
Description
request
CreateRoomRequest
✔️
The request object to use for the request.
CreateRoomResponse
Error Object
Status Code
Content Type
HathoraCloud.Models.Errors.ApiError
400,401,402,404,422,429,500
application/json
HathoraCloud.Models.Errors.SDKException
4xx-5xx
/
Destroy a room . All associated metadata is deleted.
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" ) ;
DestroyRoomRequest req = new DestroyRoomRequest ( ) {
RoomId = "2swovpy1fnunu" ,
} ;
using ( var res = await sdk . RoomsV2 . DestroyRoomAsync ( req ) )
{
// handle response
}
Parameter
Type
Required
Description
request
DestroyRoomRequest
✔️
The request object to use for the request.
DestroyRoomResponse
Error Object
Status Code
Content Type
HathoraCloud.Models.Errors.ApiError
401,404,429,500
application/json
HathoraCloud.Models.Errors.SDKException
4xx-5xx
/
Get all active rooms for a given process .
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" ) ;
GetActiveRoomsForProcessRequest req = new GetActiveRoomsForProcessRequest ( ) {
ProcessId = "cbfcddd2-0006-43ae-996c-995fff7bed2e" ,
} ;
using ( var res = await sdk . RoomsV2 . GetActiveRoomsForProcessAsync ( req ) )
{
// handle response
}
GetActiveRoomsForProcessResponse
Error Object
Status Code
Content Type
HathoraCloud.Models.Errors.ApiError
401,404,429
application/json
HathoraCloud.Models.Errors.SDKException
4xx-5xx
/
Poll this endpoint to get connection details to a room . Clients can call this endpoint without authentication.
using HathoraCloud ;
using HathoraCloud . Models . Shared ;
using HathoraCloud . Models . Operations ;
var sdk = new HathoraCloudSDK ( appId : "app-af469a92-5b45-4565-b3c4-b79878de67d2" ) ;
GetConnectionInfoRequest req = new GetConnectionInfoRequest ( ) {
RoomId = "2swovpy1fnunu" ,
} ;
using ( var res = await sdk . RoomsV2 . GetConnectionInfoAsync ( req ) )
{
// handle response
}
GetConnectionInfoResponse
Error Object
Status Code
Content Type
HathoraCloud.Models.Errors.ApiError
400,402,404,422,429,500
application/json
HathoraCloud.Models.Errors.SDKException
4xx-5xx
/
GetInactiveRoomsForProcess
Get all inactive rooms for a given process .
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" ) ;
GetInactiveRoomsForProcessRequest req = new GetInactiveRoomsForProcessRequest ( ) {
ProcessId = "cbfcddd2-0006-43ae-996c-995fff7bed2e" ,
} ;
using ( var res = await sdk . RoomsV2 . GetInactiveRoomsForProcessAsync ( req ) )
{
// handle response
}
GetInactiveRoomsForProcessResponse
Error Object
Status Code
Content Type
HathoraCloud.Models.Errors.ApiError
401,404,429
application/json
HathoraCloud.Models.Errors.SDKException
4xx-5xx
/
Retreive current and historical allocation data for a room .
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" ) ;
GetRoomInfoRequest req = new GetRoomInfoRequest ( ) {
RoomId = "2swovpy1fnunu" ,
} ;
using ( var res = await sdk . RoomsV2 . GetRoomInfoAsync ( req ) )
{
// handle response
}
Parameter
Type
Required
Description
request
GetRoomInfoRequest
✔️
The request object to use for the request.
GetRoomInfoResponse
Error Object
Status Code
Content Type
HathoraCloud.Models.Errors.ApiError
401,404,422,429
application/json
HathoraCloud.Models.Errors.SDKException
4xx-5xx
/
Suspend a room . The room is unallocated from the process but can be rescheduled later using the same roomId
.
⚠️ DEPRECATED : This will be removed in a future release, please migrate away from it as soon as possible.
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" ) ;
SuspendRoomV2DeprecatedRequest req = new SuspendRoomV2DeprecatedRequest ( ) {
RoomId = "2swovpy1fnunu" ,
} ;
using ( var res = await sdk . RoomsV2 . SuspendRoomV2DeprecatedAsync ( req ) )
{
// handle response
}
SuspendRoomV2DeprecatedResponse
Error Object
Status Code
Content Type
HathoraCloud.Models.Errors.ApiError
401,404,429,500
application/json
HathoraCloud.Models.Errors.SDKException
4xx-5xx
/
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" ) ;
UpdateRoomConfigRequest req = new UpdateRoomConfigRequest ( ) {
UpdateRoomConfigParams = new UpdateRoomConfigParams ( ) {
RoomConfig = "{\" name\" :\" my-room\" }" ,
} ,
RoomId = "2swovpy1fnunu" ,
} ;
using ( var res = await sdk . RoomsV2 . UpdateRoomConfigAsync ( req ) )
{
// handle response
}
UpdateRoomConfigResponse
Error Object
Status Code
Content Type
HathoraCloud.Models.Errors.ApiError
401,404,429,500
application/json
HathoraCloud.Models.Errors.SDKException
4xx-5xx
/