I am getting error_code 10006 from the OKEX API when attempting to make a withdrawal. Is anyone else having this issue?
Other methods such as placing orders, checking balances etc. work fine with the exact same API key and secret. withdraw_info however also gives error 10006.
I've checked and Withdraw privileges is definitely turned on for the API key in my OKEX account.
I've also contacted OKEX customer support and they've been telling me to change the withdrawal symbol from btc_usd to btc_usdt, and then from btc_usdt back to btc_usd over and over for a couple of days now.
If anyone has had the same problem please do let me know. Thank you very much in advance.
Here is the dump from CCXT:
strong textFatal error: Uncaught exception 'ccxt\ExchangeError' with message 'okex {"result":false,"error_code":10006}' in /home/php/okcoinusd.php:721
Stack trace:
#0 /home/php/Exchange.php(957): ccxt\okcoinusd->handle_errors(200, '', 'https://www.oke...', 'POST', Array, '{"result":false...')
#1 /home/php/Exchange.php(801): ccxt\Exchange->fetch('https://www.oke...', 'POST', Array, 'api_key=cff1b19...')
#2 /home/php/Exchange.php(805): ccxt\Exchange->fetch2('withdraw', 'private', 'POST', Array, NULL, NULL)
#3 [internal function]: ccxt\Exchange->request('withdraw', 'private', 'POST', Array)
#4 /home/php/Exchange.php(740): call_user_func(Array, 'withdraw', 'private', 'POST', Array)
#5 [internal function]: ccxt\Exchange->ccxt{closure}(Array)
#6 /home/php/Exchange.php(1752): call_user_func_array(Object(Closure), Array)
#7 /home/php/okcoinusd.php(678): ccxt\Exchange->__call('privatePostWith...', Array)
#8 /home/p in /home/php/okcoinusd.php on line 721
The OKEX API requires a trade_pwd
(your trading password) for funding and for placing orders, so, when you write it in double quotes in PHP:
echo "23\5$foo"; // prints "23"
↑ then you'll notice that some symbols are missing in the output. So, never write passwords in double quotes in PHP, use single quotes:
echo '23\5$foo'; // outputs "23\5$foo"
The above is also partially true for passwords in JSON files. Slash and backslash symbols (/
, \
) are often in conflict with double-quotes when it comes to passwords and paths. This may be a reason for OKEX withdraw authentication error {"result":false,"error_code":10006}
.