hitbtc-com / hitbtc-api

HitBTC API
GNU Lesser General Public License v3.0
324 stars 153 forks source link

Method 'order ' always returns 'Symbol not found' #214

Closed stefanbu closed 5 years ago

stefanbu commented 5 years ago

Using the REST API v2 works without problems for me, with one important exception with the method 'order'. I am not able to place a trade.

I always get back this (independent of the used parameters): {"error":{"code":2001,"message":"Symbol not found","description":"Try get /api/2/public/symbol, to get list of all available symbols."}}

Example -URL: "https://api.hitbtc.com/api/2/order?symbol=ETHBTC&side=buy&type=limit&timeInForce=GTC&quantity=0.1&price=0.02"

Code: HTTPMethod="POST" URL = "https://api.hitbtc.com/api/2/order?symbol=ETHBTC&side=buy&type=limit&timeInForce=GTC&quantity=0.1&price=0.02"

' Instantiate a WinHttpRequest object and open it Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")

objHTTP.Open HTTPMethod, URL, False objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" objHTTP.setRequestHeader "accept", "application/json" objHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" objHTTP.setRequestHeader "Authorization", "Basic " & Base64Encode(apikey & ":" & secretkey) objHTTP.Send ("")

objHTTP.WaitForResponse PrivateHitBTC2 = objHTTP.ResponseText Set objHTTP = Nothing

hitbtc-com commented 5 years ago

You have to send data 'symbol=ETHBTC&side=buy&type=limit&timeInForce=GTC&quantity=0.1&price=0.02' as payload on POST or PUT request. See curl & python example at doc https://api.hitbtc.com/#create-new-order

cenekSvoboda commented 3 years ago

I still have the same problem...

filinvadim commented 2 years ago

They're forgot about header "Content-Type: application/x-www-form-urlencoded" . Terrible API.