BTCMarkets / API

API
120 stars 30 forks source link

Bad request when using POST with no data (/order/open) #162

Closed codeandvisual closed 5 years ago

codeandvisual commented 5 years ago

I've got both POST and GET operations authenticating and working for a number of end points, except for the V1 /order/open end point.

Seeming as there's no parameters for it, the request body I'm sending through is an empty string.

I'm getting this response from the server:

"timestamp": 1560753911696,
"status": 400,
"error": "Bad Request",
"exception": "org.springframework.http.converter.HttpMessageNotReadableException",
"message": "Required request body is missing: public java.lang.Object com.marketngin.api.entrypoint.OrderAPI.getOpenOrders(com.marketngin.api.domain.order.OrderHistoryRequest,javax.servlet.http.HttpServletRequest) throws java.lang.Exception",
"path": "/order/open"

I can use the V2 version of the end point fine, but I am curious - am I doing something wrong? How can the POST calls work when there's no data for the request body? Is there a place holder to use?

martin-nginio commented 5 years ago

Hi @codeandvisual

Thanks for your feedback.

The API endpoint you mentioned still needs needs a request body like below in order to work: {"currency":"AUD","instrument":"BTC","limit":5}

Regards, Martin

codeandvisual commented 5 years ago

Thanks Martin - tested and works!

It doesn't mention this in the API docs as far as I could see though, would be good to add it.