Echoo文档中心Echoo文档中心
Home
Echoo HTTP API
Home
Echoo HTTP API
  • 租赁服-添加玩家ID /api/rental/add_player

租赁服-添加玩家ID /api/rental/add_player

您可以使用这个API添加指定服务器玩家ID

返回API列表

请求地址

POST /api/rental/add_player

请求头

无

请求参数

调用类型:POST form-data

  • user_id 登录返回的userid
  • e_id 服务器entity_id
  • player_name 要添加的玩家ID

调用返回

返回类型:Json

返回示例:

{"code": 0, "message": "添加成功,如玩家ID列表刷新后未出现为添加失败"}

参数解释:

  • code——只有code为0时代表请求成功,如果请求失败错误原因会显示在message里
  • message——错误信息或成功信息

特别提醒:如添加后在玩家列表找不到ID为添加失败

示例代码

Python:

import requests
from requests_toolbelt import MultipartEncoder

url = 'http://127.0.0.1:21000/api/rental/add_player'

m = MultipartEncoder(
fields={
  'user_id': ('', 'userid'),
  'e_id': ('', 'entity_id'),
  'player_name': ('', '要添加的玩家ID'),
}
)

headers = {
'Content-Type': m.content_type
}

response = requests.post(url, data=m, headers=headers)

print(response.status_code)
print(response.text)
最近更新:: 2025/11/23 19:14