---
title: リーダーボード内の特定のランキングデータの削除
slug: world-sdk-guide-ja/kOLhgBNiqPbJX5F4e1e-2
docTags: 
createdAt: 2024-09-02T08:34:13.134Z
---

OpenAPIを使用して、リーダーボード内の特定のランキングデータを削除できます。

OpenAPIを使用するには、まず [OpenAPIキーを取得する](docId\:vvV0UxsyuYdAGhXUFJQtm) ZEPETO Studioから取得してください。

その後、 [JWT認証トークンを取得する](docId\:P0Ka4R-sqiZ6L3raKC-b8) OpenAPIフォーマットに従って、 [ランキング削除OpenAPI](docId\:GnYTfcTBMKQhT8skRqJkF) を呼び出します。

:::hint{type="danger"}
- JWT認証トークンが発行された時刻と同じUTCタイムスタンプ値を入力してください。
:::



## 例のコード - Python

```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)
```

