0

Issue with sending data via HTTP request in Ninox (JSON format)

Hello
    Problem Description: I am trying to integrate the eKassa API with my system via Ninox and send data using an HTTP request. However, when attempting to send the request with data in JSON format, I get the error "column not found." I have verified that all the necessary fields for sending the data exist and are correctly specified in the formula.

let publicKey := Public_Key;
let privateKey := Private_Key;
let token := Token;

let articleName := Sales_tab.Product_Name;
let price := number(Sales_tab.Price);
let quantity := number(Sales_tab.Quantity);
let totalAmount := number(Total_Amount);
let paymentMethod := Payment_method;

let headers := {
    "Authorization": "Bearer " + token,
    "Public-Key": publicKey,
    "Private-Key": privateKey,
    "Content-Type": "application/json"
};

let bodyData := {
    "sales": [{
        "name": articleName,
        "price": price,
        "quantity": quantity
    }],
    "payments": {
        "0": {
            "pay_code": 0,
            "label": paymentMethod,
            "value": totalAmount
        }
    }
};

let response := http("POST", "https://your-api-url.com/endpoint", {
    headers: headers,
    body: JSON.stringify(bodyData)
});

if (response.status == 200) {
    alert("Request successful");
} else {
    alert("Error: " + response.status);
}

 

 

Instead of receiving the expected successful response, I get the error: "column not found."
I’ve confirmed that all the fields exist, but the error persists. The issue arises specifically when attempting to use JSON with JSON.stringify.
I would appreciate any help in identifying what might be wrong, or recommendations on how to correctly send data in JSON format from Ninox.

1 reply

null
    • Ninox partner
    • RoSoft_Steven.1
    • yesterday
    • Reported - view

      try with this version  in line 33 to line 36:

    let response := do as server http("POST", "https://your-api-url.com/endpoint", headers, bodyData) end;