*此內容是使用 AI(Beta 測試版)翻譯,可能含有錯誤。若要以英文檢視此頁面,請按一下這裡

Universe

代表 Roblox 體驗。

特性

pathstring

宇宙的資源路徑。

格式:universes/{universe_id}.

createTimestring
僅限輸出

宇宙創建時的時戳。. 此字串的格式為 Timestamp

updateTimestring
僅限輸出

宇宙上次更新時的時戳。. 此字串的格式為 Timestamp

displayNamestring
僅限輸出

宇宙的名稱。

此欄位可以通過更新根位置的名稱來更新。.

descriptionstring
僅限輸出

宇宙的描述。

此欄位可以通過更新根位置的描述來更新。.

owner 請選擇其中一項:

userstring
僅限輸出

宇宙是使用者所有的。.

groupstring
僅限輸出

宇宙是群體所有的。.

visibilityEnum<string>
僅限輸出

宇宙是否公開可用。

可能的值:

| 值 | 說明 | | --- | --- | | VISIBILITY_UNSPECIFIED | 使用此值進行更新時,將在後端發生錯誤。| | 公共 | 宇宙是公共的。| | 私人 | 宇宙是私人的。如果宇宙的可見度設為私人,所有啟用的玩家將立即從所有運行的伺服器中移除。|. 可能的值:

facebookSocialLinkobject

Facebook 的社交鏈接。.

twitterSocialLinkobject

Twitter 社交鏈接。.

youtubeSocialLinkobject

Youtube 社交鏈接。.

twitchSocialLinkobject

Twitch 社交鏈接。.

discordSocialLinkobject

Discord 社交鏈接。.

robloxGroupSocialLinkobject

Roblox 群組的社交鏈接。.

guildedSocialLinkobject

公會的社交鏈接。.

voiceChatEnabledboolean

體驗中的使用者是否啟用語音聊天。

更新此值不會影響已啟用的伺服器。.

ageRatingEnum<string>
僅限輸出

這個宇宙的年齡評級。

可能的值:

| 值 | 說明 | | --- | --- | | AGE_RATING_UNSPECIFIED | 年齡評分未設置。| | AGE_RATING_ALL | 對所有使用者提供支持。| | AGE_RATING_9_PLUS | 支持 9 歲及以上的使用者。| | AGE_RATING_13_PLUS | 支持 13 歲及以上的使用者。| | AGE_RATING_17_PLUS | 支持 17 歲及以上的使用者。 |. 可能的值:

privateServerPriceRobuxnumber

代表私人伺服器的 Robux 價格。

如果未設置,私人伺服器對於此宇宙不支持。

只能在使用欄位面具時停用。

設置為 null 將停用所有已啟用的私人伺服器。

變更價格將取消所有私人伺服器訂閱。.

desktopEnabledboolean

玩家是否可以透過桌面加入體驗。.

mobileEnabledboolean

玩家是否可以透過手機加入體驗。.

tabletEnabledboolean

玩家是否可以透過平板電腦加入體驗。.

consoleEnabledboolean

玩家是否可以透過控制台加入體驗。.

vrEnabledboolean

玩家是否可以透過 VR 加入體驗。.

基本網址

https://apis.roblox.com
Universe資源

{
"path": "universes/123",
"createTime": "2023-07-05T12:34:56Z",
"updateTime": "2023-07-05T12:34:56Z",
"displayName": "ROBLOX Battle [OPEN]",
"description": "OPEN SOURCE! \n Feel free to check out how we made this game and ask us about it!",
"user": "string",
"visibility": "VISIBILITY_UNSPECIFIED",
"facebookSocialLink": {
"title": "string",
"uri": "string"
},
"twitterSocialLink": {
"title": "string",
"uri": "string"
},
"youtubeSocialLink": {
"title": "string",
"uri": "string"
},
"twitchSocialLink": {
"title": "string",
"uri": "string"
},
"discordSocialLink": {
"title": "string",
"uri": "string"
},
"robloxGroupSocialLink": {
"title": "string",
"uri": "string"
},
"guildedSocialLink": {
"title": "string",
"uri": "string"
},
"voiceChatEnabled": true,
"ageRating": "AGE_RATING_UNSPECIFIED",
"privateServerPriceRobux": "integer",
"desktopEnabled": true,
"mobileEnabled": true,
"tabletEnabled": true,
"consoleEnabled": true,
"vrEnabled": true
}

Universe

取得宇宙

GET /cloud/v2/universes/{universe_id}

取得指定的宇宙。

請求路徑參數
universe_idstring
需要

宇宙ID。.

回應Universe
GET /cloud/v2/universes/{universe_id}

curl -L -X GET 'https://apis.roblox.com/cloud/v2/universes/{universe_id}' \
-H 'x-api-key: {your-api-key}'
回應

{
"path": "universes/123",
"createTime": "2023-07-05T12:34:56Z",
"updateTime": "2023-07-05T12:34:56Z",
"displayName": "ROBLOX Battle [OPEN]",
"description": "OPEN SOURCE! \n Feel free to check out how we made this game and ask us about it!",
"user": "string",
"visibility": "VISIBILITY_UNSPECIFIED",
"facebookSocialLink": {
"title": "string",
"uri": "string"
},
"twitterSocialLink": {
"title": "string",
"uri": "string"
},
"youtubeSocialLink": {
"title": "string",
"uri": "string"
},
"twitchSocialLink": {
"title": "string",
"uri": "string"
},
"discordSocialLink": {
"title": "string",
"uri": "string"
},
"robloxGroupSocialLink": {
"title": "string",
"uri": "string"
},
"guildedSocialLink": {
"title": "string",
"uri": "string"
},
"voiceChatEnabled": true,
"ageRating": "AGE_RATING_UNSPECIFIED",
"privateServerPriceRobux": "integer",
"desktopEnabled": true,
"mobileEnabled": true,
"tabletEnabled": true,
"consoleEnabled": true,
"vrEnabled": true
}

Universe

更新宇宙

PATCH /cloud/v2/universes/{universe_id}

更新指定的宇宙。

這個方法保證返回所有更新的欄位。此方法可能還會返回完整資源。

範圍
universe:write
請求路徑參數
universe_idstring
需要

宇宙ID。.

查詢參數
updateMaskstring

要更新的字段列表。. 此字串的格式為 FieldMask

請求主體Universe
回應Universe
PATCH /cloud/v2/universes/{universe_id}

curl -L -X PATCH 'https://apis.roblox.com/cloud/v2/universes/{universe_id}?updateMask={string}' \
-H 'x-api-key: {your-api-key}' \
-H 'Content-Type: application/json' \
--data '{
"facebookSocialLink": {
"title": "string",
"uri": "string"
},
"twitterSocialLink": {
"title": "string",
"uri": "string"
},
"youtubeSocialLink": {
"title": "string",
"uri": "string"
},
"twitchSocialLink": {
"title": "string",
"uri": "string"
},
"discordSocialLink": {
"title": "string",
"uri": "string"
},
"robloxGroupSocialLink": {
"title": "string",
"uri": "string"
},
"guildedSocialLink": {
"title": "string",
"uri": "string"
},
"voiceChatEnabled": true,
"privateServerPriceRobux": "integer",
"desktopEnabled": true,
"mobileEnabled": true,
"tabletEnabled": true,
"consoleEnabled": true,
"vrEnabled": true
}'
回應

{
"path": "universes/123",
"createTime": "2023-07-05T12:34:56Z",
"updateTime": "2023-07-05T12:34:56Z",
"displayName": "ROBLOX Battle [OPEN]",
"description": "OPEN SOURCE! \n Feel free to check out how we made this game and ask us about it!",
"user": "string",
"visibility": "VISIBILITY_UNSPECIFIED",
"facebookSocialLink": {
"title": "string",
"uri": "string"
},
"twitterSocialLink": {
"title": "string",
"uri": "string"
},
"youtubeSocialLink": {
"title": "string",
"uri": "string"
},
"twitchSocialLink": {
"title": "string",
"uri": "string"
},
"discordSocialLink": {
"title": "string",
"uri": "string"
},
"robloxGroupSocialLink": {
"title": "string",
"uri": "string"
},
"guildedSocialLink": {
"title": "string",
"uri": "string"
},
"voiceChatEnabled": true,
"ageRating": "AGE_RATING_UNSPECIFIED",
"privateServerPriceRobux": "integer",
"desktopEnabled": true,
"mobileEnabled": true,
"tabletEnabled": true,
"consoleEnabled": true,
"vrEnabled": true
}

Universe

發布宇宙訊息
Beta

POST /cloud/v2/universes/{universe_id}:publishMessage

發布訊息到宇宙的實時伺服器。

伺服器可以透過 傳送服務 來消耗訊息。

範圍
universe-messaging-service:publish
請求路徑參數
universe_idstring
需要

宇宙ID。.

請求主體
topicstring

要發布訊息的主題。.

messagestring

要發布的訊息。.

POST /cloud/v2/universes/{universe_id}:publishMessage

curl -L -X POST 'https://apis.roblox.com/cloud/v2/universes/{universe_id}:publishMessage' \
-H 'x-api-key: {your-api-key}' \
-H 'Content-Type: application/json' \
--data '{
"topic": "my-topic",
"message": "Hello, world!"
}'

Universe

重新啟動宇宙服務器

POST /cloud/v2/universes/{universe_id}:restartServers

如果和只有發布了新版本的體驗,重新啟動所有已啟用的伺服器以進入特定宇宙。用於發布體驗更新。

範圍
universe:write
請求路徑參數
universe_idstring
需要

宇宙ID。.

請求主體
回應
POST /cloud/v2/universes/{universe_id}:restartServers

curl -L -X POST 'https://apis.roblox.com/cloud/v2/universes/{universe_id}:restartServers' \
-H 'x-api-key: {your-api-key}' \
-H 'Content-Type: application/json' \
--data '{}'
回應

{}