Hello everyone, and good evening from Korea!
I’ve been using Binance API for years and haven’t encountered circumstances like today’s.
The main reason might be that I started to using the Auto-Invest API endpoints.
Today, I spent several hours very focused and tried to resolve the issue myself, and now I’m here, just after signing up for this community. It’s great to be a member here.
I faced two types of troubles:
- Converting parameters into a querystring format from a nested object.
- Nodejs doesn’t have built-in functions that can do this, so I created a function with outputs like this:
details[0][targetAsset]=BTC&details[0][percentage]=100
- This attempt seems to have ended ok, I believe.
- I believe my request was made correctly after encoutering various errors, but it still doesn’t work.
Please review my request and the Unknown error response.
- request
https://api.binance.com/sapi/v1/lending/auto-invest/plan/edit?planId=6100000&subscriptionAmount=1&subscriptionCycle=DAILY&subscriptionStartTime=1&sourceAsset=USDT&details[0][targetAsset]=BTC&details[0][percentage]=100×tamp=1694183179933&signature=1b951XXXX {
method: 'POST',
headers: {
'X-MBX-APIKEY': 'ABcd...'
}
}
- response
Binance API error response: {
code: -1000,
msg: 'An unknown error occurred while processing the request.'
}