###
**Operating System**
Linux (Ubuntu 20.04.6 LTS)
**Programming Languag…es**
PHP 8.2
**CCXT Version**
3.0.51
**Description**
**I'm using Binance Futures testnet.**
When I run fetch_order I get the following **intermittent** error: **GET 401 Invalid API-key, IP, or permissions for action** . I'm running a cron job that checks the order statuses (about 20/min), and sometimes I get the 401, most of the time it is OK.
**Configuration:**
```
$cctx = new binanceusdm();
$cctx->apiKey = $this->apiConnection->api_key;
$cctx->secret = $this->apiConnection->api_secret;
$cctx->verbose = true;
$cctx->options = [
'defaultType' => 'future',
'recvWindow' => 7000,
'adjustForTimeDifference' => true,
'newOrderRespType' => 'FULL',
'defaultTimeInForce' => 'GTC',
'loadTimeDifference' => true,
'timeout' => 30000,
'enableRateLimit' => false, // same with 'enableRateLimit' => true
$cctx->set_sandbox_mode(config('binance.test')); //true
$cctx->load_markets();
];
```
**Fetch order code**
```
$this->cctx->fetch_order($order->order_id, $cctxSymbol), [
'timestamp' => time() * 1000,
'type' => ($this->isFuture ? 'future' : 'spot'),
]);
```
**The error:**
```
binanceusdm binanceusdm https://testnet.binancefuture.com/fapi/v1/order?timestamp=1680558984000&symbol=BTCUSDT
&orderId=xxxxxxxx&recvWindow=7000&signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
GET 401 Invalid API-key, IP, or permissions for action
Trace
[
{
"file": "vendor/ccxt/ccxt/php/Exchange.php",
"line": 1541,
"function": "handle_http_status_code",
"class": "ccxt\\Exchange",
"type": "->"
},
{
"file": "vendor/ccxt/ccxt/php/Exchange.php",
"line": 3538,
"function": "fetch",
"class": "ccxt\\Exchange",
"type": "->"
},
{
"file": "vendor/ccxt/ccxt/php/binance.php",
"line": 7349,
"function": "fetch2",
"class": "ccxt\\Exchange",
"type": "->"
},
{
"file": "vendor/ccxt/ccxt/php/abstract/binanceusdm.php",
"line": 2585,
"function": "request",
"class": "ccxt\\binance",
"type": "->"
},
{
"file": "vendor/ccxt/ccxt/php/binance.php",
"line": 4110,
"function": "fapiPrivateGetOrder",
"class": "ccxt\\abstract\\binanceusdm",
"type": "->"
},
Line
2107
File
vendor/ccxt/ccxt/php/Exchange.php
```
I used sleep(5), after each fetch_order run, but I still get the error intermittently.