文档中心 > API类目 > 淘宝互动平台开放招募

taobao.interaction.game.event (上报游戏特定事件用于统计用户状态,激励用户行为)

上报游戏特定事件用于统计用户状态,激励用户行为

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
event GameEventDTO 必须 事件信息
  • └ user_id
  • String
  • 必须
  • 123
  • 12414
  • └ type
  • String
  • 必须
  • win_game
  • 事件类型
  • └ delta
  • Number
  • 必须
  • 1
  • 事件影响数值
  • └ id
  • String
  • 必须
  • PKWIN5543
  • 事件的唯一ID,用于去重统计。
  • └ scope
  • String
  • 必须
  • room
  • 业务打标主场景;用于数据归类
  • └ sub_scope
  • String
  • 必须
  • result
  • 业务打标子场景;用于数据归类

响应参数

名称 类型 示例值 描述
result BizResult 返回结果
  • └ success
  • Boolean
  • true
  • 是否成功
  • └ msg_code
  • String
  • SUCCESS
  • 错误号
  • └ msg_info
  • String
  • xxxService error
  • 具体错误信息
  • └ model
  • Boolean
  • true
  • 固定字段
  • └ can_retry
  • Boolean
  • false
  • 是否可重试,默认都不可以重试

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
InteractionGameEventRequest req = new InteractionGameEventRequest();
InteractionGameEventRequest.GameEventDTO obj1 = new InteractionGameEventRequest.GameEventDTO();
obj1.setUserId("123");
obj1.setType("win_game");
obj1.setDelta(1L);
obj1.setId("PKWIN5543");
obj1.setScope("room");
obj1.setSubScope("result");
req.setEvent(obj1);
InteractionGameEventResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<interaction_game_event_response>
    <result>
        <success>true</success>
        <msg_code>SUCCESS</msg_code>
        <msg_info>xxxService error</msg_info>
        <model>true</model>
        <can_retry>false</can_retry>
    </result>
</interaction_game_event_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

返回
顶部