Help Needed: Error in HTTP Request Node - "Mandatory parameter 'symbol' was not sent, was empty/null, or malformed"

Hello there

I am currently building a trading automation workflow connected to Binance Testnet. Despite several attempts and adjustments, I keep encountering an issue with my HTTP Request (5) node. Here’s the error message:

“Bad request - please check your parameters
Mandatory parameter ‘symbol’ was not sent, was empty/null, or malformed.”

What I’ve Tried:

  1. Ensured proper data flow:
    The Code (2) node outputs the correct structure, including all necessary parameters: symbol, side, type, timeInForce, quantity, price, timestamp, and signature.

  2. Validated the JSON body:
    I used JSONLint to validate the JSON body in the HTTP Request (5) node. The structure is valid and looks like this:

{
  "symbol": "BTCUSDT",
  "side": "BUY",
  "type": "LIMIT",
  "timeInForce": "GTC",
  "quantity": 0.01,
  "price": {{$node["Code (2)"].json.price}},
  "timestamp": {{$node["Code (2)"].json.timestamp}},
  "signature": "{{$node["Code (2)"].json.signature}}"
}
  1. Checked URL correctness:
    The node is configured to send a POST request to https://testnet.binance.vision/api/v3/order.

  2. Verified credentials and headers:
    The X-MBX-APIKEY header is set up correctly in the Send Headers section of the node, referencing a valid API key.

  3. Synchronized timestamps:
    I confirmed that the timestamp generated in the workflow aligns with Binance’s server timestamp. The difference is consistently below 500ms.

  4. Tested with cURL:
    A similar request using cURL produces the same error message, indicating the issue is not limited to n8n.

Questions and Context

  • Has anyone encountered a similar issue with Binance Testnet and n8n?
  • Could this be related to how n8n processes dynamic expressions in the JSON body?
  • Is there an alternative approach for passing query parameters (e.g., via Send Query Parameters instead of Send Body)?

I would appreciate any insights or suggestions to resolve this issue. If additional details are needed, let me know.

The workflow

Thanks a lot for your help in advance!

Information on my n8n setup

  • n8n version: 1.67.1
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): cloud
  • Operating system: MacOS 10.13.6

Hi @DMdaC

It should work with using the query parameters within the HTTP node options:

Maybe because you were sending it in the body as well?

@DMdaC
did you manage to make it work ?

personnaly I’m bloc at the signature part

via CURL it would be something like:

echo -n “symbol=BTCUSDT&side=BUY&type=LIMIT&quantity=1&price=9000&timeInForce=GTC&recvWindow=5000&timestamp=1591702613943” | openssl dgst -sha256 -hmac “MY_SECRET_KEY”

and in Python

import hashlib
import hmac
import time

Binance API keys

api_key = “YOUR_API_KEY”
secret_key = “YOUR_SECRET_KEY”

Parameters

params = {
“symbol”: “BTCUSDT”,
“side”: “BUY”,
“type”: “LIMIT”,
“quantity”: 1,
“price”: 9000,
“timeInForce”: “GTC”,
“recvWindow”: 5000,
“timestamp”: int(time.time() * 1000) # Current timestamp in milliseconds
}

Create query string

query_string = “&”.join([f"{key}={value}" for key, value in params.items()])

Generate HMAC SHA256 signature

signature = hmac.new(
secret_key.encode(‘utf-8’),
query_string.encode(‘utf-8’),
hashlib.sha256
).hexdigest()

Add signature to query string

signed_query_string = f"{query_string}&signature={signature}"

print(“Signed Query String:”, signed_query_string)