P
P
Python Newbie2021-10-04 07:18:44
Python
Python Newbie, 2021-10-04 07:18:44

Why does an error appear when working with bitforex api?

I have this code:

import requests
from datetime import datetime
import time
from data import bitforex_api_config as bt


def get_order_information(state, tradeType, signData='hello', symbol='coin-usd-eth'):
    url = f'https://api.bitforex.com/api/v1/trade/orderInfo?symbol={symbol}&state={int(state)}&tradeType={int(tradeType)}&accessKey={bt.CONFIG["API_KEY"]}&nonce={int(time.time() * 1000)}&signData={signData}'
    print(url)
    response = requests.post(url)
    return response.json()
print(get_order_information(0, 0))


It outputs:
https://api.bitforex.com/api/v1/trade/orderInfo?symbol=coin-usd-eth&state=0&tradeType=0&accessKey=######391a########24####c7&nonce=1633320886397&signData=hello
{'code': '1016', 'success': False, 'time': 1633320887804, 'message': 'SignData Invalid'}


Why am I getting a SignData Invalid response?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question