文档中心 > API类目 > 云游戏API

alibaba.cloudgame.interactive.game.room.create (建游戏房间)

建游戏房间

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
create_room_request CreateRoomRequest 必须 请求
  • └ mix_game_id
  • String
  • 必须
  • cgeabntyjfjdtg
  • 游戏id
  • └ user_id
  • String
  • 必须
  • 1234
  • 主播用户id
  • └ token
  • String
  • 可选
  • xxxx
  • 验签token

响应参数

名称 类型 示例值 描述
result Result 返回结果
  • └ code
  • String
  • 0
  • 状态码
  • data
  • CreateRoomResponse
  • 返回结果
  • └ room_id
  • Number
  • 1
  • 房间id
  • └ ext_info
  • String
  • {}
  • 扩展数据
  • └ message
  • String
  • OK
  • 返回提示信息

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaCloudgameInteractiveGameRoomCreateRequest req = new AlibabaCloudgameInteractiveGameRoomCreateRequest();
AlibabaCloudgameInteractiveGameRoomCreateRequest.CreateRoomRequest obj1 = new AlibabaCloudgameInteractiveGameRoomCreateRequest.CreateRoomRequest();
obj1.setMixGameId("cgeabntyjfjdtg");
obj1.setUserId("1234");
obj1.setToken("xxxx");
req.setCreateRoomRequest(obj1);
AlibabaCloudgameInteractiveGameRoomCreateResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_cloudgame_interactive_game_room_create_response>
    <result>
        <code>0</code>
        <data>
            <room_id>1</room_id>
            <ext_info>{}</ext_info>
        </data>
        <message>OK</message>
    </result>
</alibaba_cloudgame_interactive_game_room_create_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部