新しいv2 APIへの基本認証api呼び出しを作成しようとしていて、無効なapiキーエラーが返されました。bitfinex api v2エラー、無効なキー
同じエラーを確認するためにAPIキーを再発行しました。
from time import time
import urllib.request
import urllib.parse
import hashlib
import hmac
APIkey = b'myapikeyyouarenotsupposedtosee'
secret = b'myceeeeecretkeyyyy'
url = 'https://api.bitfinex.com/v2/auth/r/wallets'
payload = {
#'request':'/auth/r/wallets',
'nonce': int(time() * 1000),
}
paybytes = urllib.parse.urlencode(payload).encode('utf8')
print(paybytes)
sign = hmac.new(secret, paybytes, hashlib.sha512).hexdigest()
print(sign)
headers = {
'Key': APIkey,
'Sign': sign
}
req = urllib.request.Request(url, headers=headers, data=paybytes)
with urllib.request.urlopen(req) as response:
the_page = response.read()
print(the_page)
bitfinexの新しいv2 APIへの認証されたAPIコールを作成するにはどうすればよいですか?
あなたはPHPのためにそれを必要とするか、またはPHPと比較する:https://stackoverflow.com/a/46851626/2635490 – Phil