how to use api_tool result in following node.
# support
s
I used an api_tool. In the log i am seeing the following result { "name": "get_events_vapi", "role": "tool_call_result", "time": 1749668533604, "result": "{\"option_request_id\": \"recx350X6P2CCTCO9\"}", "toolCallId": "b09ad572", "secondsFromStart": 34.805 } However when i use option_request_id in the next node which is an api_tool node Name option_request_id Type String Value {{option_request_id}} it shows in my call log it is empty { "role": "tool_calls", "time": 1749668537173, "message": "", "toolCalls": [ { "id": "db2de25b", "type": "function", "function": { "name": "Check_options", "arguments": "{\"option_request_id\": \"\"}" } } ], "secondsFromStart": 38.374 } Am i doing something wrong? @Kings_big💫
c
Hey! To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) - What response you expected to get - What response you actually got instead This would really help us figure out what went wrong!
s
hi thanks for your response I tried something else but got th same issue. I thought i wasn't able to reuse the response data because i used a post request, so i tried again with a get request, but i got the same issue. The data i am getting from my server, isn't used in subsequent api_tool (post request) Call_id 7c3fdace-e228-48e4-b6ef-48a28597f0ce Fetching "option_request_id" with GET request { "role": "tool_calls", "time": 1749721512571, "message": "", "toolCalls": [ { "id": "f074d5a3", "type": "function", "function": { "name": "Get_option_request_id", "arguments": "{}" } } ], "secondsFromStart": 23.964 } Information fetched successfully { "name": "Get_option_request_id", "role": "tool_call_result", "time": 1749721512888, "result": "{\"option_request_id\": \"recNA8OiTGqm8nNxd\"}", "toolCallId": "f074d5a3", "secondsFromStart": 24.281 } I then use a POST request (via api_tool) to activate a function, but my server needs the "option_request_id" So i do Request body of my api tool Name option_request_id Type string Value {{option_request_id}} MESSAGES in call log { "role": "tool_calls", "time": 1749721522129, "message": "", "toolCalls": [ { "id": "370315a8", "type": "function", "function": { "name": "Check_options", "arguments": "{\"option_request_id\": \"\"}" } } ], "secondsFromStart": 33.522 } ISSUE: "option_request_id" is empty "arguments": "{\"option_request_id\": \"\"}" and my server returns an error --------- It seems that response variables aren't saved in dynamic variables @Shubham Bajaj
Call id 39735a87-203b-4808-ba0a-8a7a22f505ca This is an example of trying to use the resspone of POST request = 'option_request_id' And using it in a subsequent POST request, but it fails to populate the 'option_request_id' in the arguments 1st post and result { "role": "tool_calls", "time": 1749669826730, "message": "", "toolCalls": [ { "id": "818d8956", "type": "function", "function": { "name": "get_events_vapi", "arguments": "{\n \"lead_id\": \"recMFOShg13366Zki\",\n \"language_id\": \"recvr7LEEosjFtclE\",\n \"option_request_id\": \"\"\n}" } } ], "secondsFromStart": 31.027 } { "name": "get_events_vapi", "role": "tool_call_result", "time": 1749669835831, "result": "{\"option_request_id\": \"recBZVOpg2C6464Mg\"}", "toolCallId": "818d8956", "secondsFromStart": 40.128 } 2ND POST and result (fail to populate) { "role": "tool_calls", "time": 1749669838627, "message": "", "toolCalls": [ { "id": "582e12b2", "type": "function", "function": { "name": "Check_options", "arguments": "{\"option_request_id\": \"\"}" } } ], "secondsFromStart": 42.924 } ERROR result from my server { "name": "Check_options", "role": "tool_call_result", "time": 1749669841188, "result": "[\n {\n \"error_code\": 400,\n \"error_field\": null,\n \"error_kind\": \"validation\",\n \"error_message\": \"Missing option_request_id in request body\",\n \"error_type\": \"ValidationError\",\n \"request_data\": \"{\\\"option_request_id\\\": \\\"\\\"}\",\n \"request_headers\": \"{\\\"Content-
c
Hey Swek, checking if this was resolved after the Discord office hours.
s
hi thanks for getting back to me. I retried my flow, still have the same issue 1) Result of GET, it fetches the option_request_id correctly { "name": "Get_option_request_id", "role": "tool_call_result", "time": 1749897741100, "result": "{\"option_request_id\": \"recPZlenc4hUn8TC6\"}", "toolCallId": "4e0cf52b", "secondsFromStart": 39.631 } 2) try to do a post request afterwards with the option_request_id, but doesn't populate { "role": "tool_calls", "time": 1749897750215, "message": "", "toolCalls": [ { "id": "8e501b9d", "type": "function", "function": { "name": "Check_options", "arguments": "{\"option_request_id\": \"\"}" } } ], "secondsFromStart": 48.746 }
s
@Kings_big💫 Can you please help him and resolve his issue? Thanks!
k
Your option_request_id isn’t being passed correctly in the POST request, ensure it's properly extracted from the GET response, not overwritten before sending, and included in a correctly formatted JSON body with the right headers (Content-Type: application/json)..
3 Views