Tool make.com webhook response not read by agent
# support
b
Is there a specific way to read the a make.com webhook response? Tried these: { "toolCallId": "call_tvDVLUJRRkdQVwjmjK9ryB23", "result":  "Output text" } { "results": [ { "toolCallId": "call_tvDVLUJRRkdQVwjmjK9ryB23", "result": "Output text"        }     ] }
v
message has been deleted
@BrightMan To read a response from a make.com webhook, you typically need to parse the JSON payload that is sent to your webhook URL. The structure of the response you receive will depend on how the make.com scenario is set up and what data it is configured to send. Both of the JSON structures you've provided are valid JSON, but they represent different ways of structuring the data: 1. The first example is a simple JSON object with two properties:
toolCallId
and
result
. 2. The second example wraps the result in an array, which could be useful if there are multiple results to return. To read the response, you would: - Wait for the HTTP POST request to your webhook URL. - Parse the JSON payload from the body of the request. - Access the data you need using the appropriate keys. For example, if you're looking for the
result
, you would access it using
response.result
for the first structure, or
response.results[0].result
for the second structure if you're expecting an array. Here's a simple example in JavaScript using Express:
Copy code
javascript
const express = require('express');
const app = express();

app.use(express.json());

app.post('/webhook', (req, res) => {
  // Assuming the first JSON structure
  const toolCallId = req.body.toolCallId;
  const result = req.body.result;

  // Do something with toolCallId and result
  console.log(`Received toolCallId: ${toolCallId} with result: ${result}`);

  // Send a response back to acknowledge receipt
  res.status(200).send('Received');
});

const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
  console.log(`Server is running on port ${PORT}`);
});
Make sure to validate the structure of the JSON payload you're expecting and handle any potential errors or different formats accordingly. If you're unsure about the structure of the response that make.com will send, you may need to consult their documentation or reach out to their support for more information.
You can continue this conversation by mentioning me in the message.
Got it. Tagging @User for additional help.
b
Call ID: 8bb5da42-d5aa-480d-900e-c50555053e2d
toolcallid: call_tvDVLUJRRkdQVwjmjK9ryB23
s
@BrightMan return the response in following format without any line breaks.
Copy code
json
{
    "results": [
        {
            "toolCallId": "X",
            "result": "Y"
        }
    ]
}
b
Sorry, but where is the line break in our response?
Sorry, but where is the line break in our response?
s
@BrightMan can you share another call id? Couldn't find relevant with this call id.
because of no response closing this ticket.
6 Views