# 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/`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://faq.finerymarkets.com/api-reference/troubleshooting-errors/error-14.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
