Reputation: 31
I am trying to place order through WebSocket on Bybit DEMO.
I get OK, but when I am trying to send order it returns:
"retMsg": "API key is invalid."
even though the auth was OK.
Currently I am using this endpoint: wss://stream.bybit.com/v5/trade
Here is log from my app.
Received:
{"retCode":0,"retMsg":"OK","op":"auth","connId":"crbb0c7flflsaujhnv00-vm86"}
Connected!
Sent:
{
"header": {
"demo":"true",
"X-BAPI-TIMESTAMP": "1725787282942"
},
"op": "order.create",
"args": [
{
"symbol": "BTCUSDT",
"side": "Buy",
"orderType": "Market",
"qty": "1"
}
]
}
Received: {"retCode":10003,"retMsg":"API key is invalid.","op":"order.create","data":{},"header":{"Traceid":"55c8108cf76d971a47f58b66fb97b05d","Timenow":"1725787282421"},"connId":"crbb0c7flflsaujhnv00-vm86"}
Correct endpoint or example for DEMO order place
Upvotes: 1
Views: 413
Reputation: 1
i think here u get your answer your auth header is not properly created please read the docs https://bybit-exchange.github.io/docs/v5/ws/connect
and check once again u need to generate API key from this URL https://www.bybit.com/app/user/api-management
Upvotes: 0