API参考
ZEPETO World Open API
在排行榜中删除特定排名数据
2分
您可以使用 openapi 删除排行榜中的特定排名数据。 要使用 openapi,请首先 管理开放 api docid\ tevie5e km35x9z5oeamp 来自 zepeto studio。 之后, 为开放api创建jwt身份验证令牌 docid qkbescnfwm rwnf4mjic 根据 openapi 格式并调用 删除世界排名 docid\ mzzqepkjoy5av2g4f8ndz 。 请在 jwt 认证令牌发放时输入相同的 utc 时间戳值。 示例代码 python import time import jwt import uuid import hashlib import base64 import requests as requests import simplejson as json access key = 'your access key' secret key = 'your secret key' uri = '/operation/v1/rank/delete' hash = hashlib sha256() hash update(uri encode()) reqtimestamp = int(time time()) json param = { "worldid" "", "leaderboardid" "", "member" "", #user id "reqtimestamp" reqtimestamp \# "prevranking" false, # nullable } param hash = hashlib sha256() param hash update(json dumps(json param, ensure ascii=false, encoding="surrogatepass") encode()) jwt payload = { 'access key' access key, 'nonce' str(uuid uuid4()), 'uri hash' base64 b64encode(hash digest()) decode('utf8'), 'body hash' base64 b64encode(param hash digest()) decode('utf8'), } jwt token = jwt encode(jwt payload, secret key) authorization = 'bearer {}' format(jwt token) print(reqtimestamp) print(authorization) url = "https //openapi zepeto zone" + uri # openapi url headers = { "accept" "application/json", "content type" "application/json", "authorization" authorization } response = requests post(url, json=json param, headers=headers) print(response status code) print(response text)