簡體   English   中英

如何獲取我當前的 user_id ..?

[英]How to get my current user_id ..?

我想使用 coinbase api 獲取用戶信息。 對於那個,我找到了 coinbase curl usl,它將為我提供用戶信息。

卷曲網址:<\/strong>

https://api.coinbase.com/v2/users/:user_id

您可以通過https://api.coinbase.com/v2/user請求向API詢問當前的用戶信息。 這將返回有關當前用戶的所有公開可用信息。

響應示例:

{
  "data": {
    "id": "9da7a204-544e-5fd1-9a12-61176c5d4cd8",
    "name": "User One",
    "username": "user1",
    "profile_location": null,
    "profile_bio": null,
    "profile_url": "https://coinbase.com/user1",
    "avatar_url": "https://images.coinbase.com/avatar?h=vR%2FY8igBoPwuwGren5JMwvDNGpURAY%2F0nRIOgH%2FY2Qh%2BQ6nomR3qusA%2Bh6o2%0Af9rH&s=128",
    "resource": "user",
    "resource_path": "/v2/user"
  }
}

如您所見,它包含您要在id字段下查找的user_id。 這應該足以獲取您的用戶信息。

你可以在 Python 中使用 de CoinBase API for Python 進入,例如:

#LIBRERIAS:
from coinbase.wallet.client import Client

# conexion a CoinBase
client = Client('xxxxxxxxxx', 'xxxxxxxxxxxxxx')

user = client.get_current_user()

print("user items: "+str(user)+'\n')

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM