# Error 14

Error 14 Invalid signature may occur when sending a REST request or connecting a WebSocket. &#x20;

* Check that you send a payload as a string.
* Check the signature is correct.

Use the following tests to check the correctness of your signature:

**REST Signature test**

```
// Generate your key and secret 
key = "your API key"
secret = "your API secret"

method = "add"
content = {
        "nonce": 49856723467362345, // Unique within a 2-min window per API key
        "timestamp": 1628489110490, // Put current timestamp
        "instrument": "BTC-USD",
        "clientOrderId": 1,
        "size": 1,
        "side": "ask",
        "type": "MarketIOC"
}
```

String to be signed:&#x20;

`add{"nonce": 49856723467362345, "timestamp": 1628489110490, "instrument": "BTC-USD", "clientOrderId": 1, "size": 1, "side": "ask", "type": "MarketIOC"}`

The correct signature should be exactly the same:&#x20;

`xvWE5m9bLUOx6TubJsXbnHPfdmYGvlbma2kuRPma0smOq47yRsG4LCak/hozAiQq`

**Websocket signature test**

```
key = "RlZ4sKsHSr5zmYKIzbtf772J9y9gx8nekd8COrawI5V"
secret = "cZpZ1vwzOaXuiONfIQVg8h6za97FoHhrwwgoSCNwDAR"

content = {"nonce": 49856723467362345, "timestamp": 1628489110490}
```

String to be signed:

`{"nonce": 49856723467362345, "timestamp": 1628489110490}`

The correct signature should be exactly the same:

`KCn9rlqILiifROYfgpGmRtvgBzSCJa/2KJ31oPKbcyE6D+BaTVfFMXo8kDwQtBC/`
