API REFERENCES
ZEPETO World Open API

리더보드 내의 특정 랭킹 데이터 삭제하기

2min
openapi를 사용하여 리더보드 내에서 특정 순위 데이터를 삭제할 수 있습니다 openapi를 사용하려면 먼저 오픈 api 관리하기 docid 1wn8 r5f0k 2bkrwzig5 zepeto studio에서 그 후, 오픈 api 사용을 위한 jwt 인증 토큰 만들기 docid\ ijx02awrpyqu1ib7w6a1a openapi 형식에 따라 호출하고 delete world ranking docid\ g5gspbrjbabnpaflszfeu jwt 인증 토큰이 발급된 시간과 동일한 utc 타임스탬프 값을 입력하세요 예제 코드 파이썬 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)