How to Pass Dynamic URL Parameters in Vapi.ai Work...
# support
e
Hi everyone 👋, I’m working on a Vapi.ai workflow and need to send dynamic URL parameters in an API Request node. I understand that I can use double curly braces for dynamic variables, like {{userId}}, but I’m unsure how to set these variables dynamically during the call. Specifically, I’m looking to: • Pass dynamic values (e.g., userId, status) into the API Request node’s URL. • Ensure these values are set correctly during the call initiation. I’ve read the Vapi documentation on dynamic variables, but I’m still a bit confused about the implementation. Could someone guide me on how to achieve this? Any examples or best practices would be greatly appreciated! Thanks in advance! 🙏
v
To pass dynamic URL parameters in a Vapi.ai Workflow API Request node, set your variables (e.g., userId, status) during call initiation by including them in the assistantOverrides.variableValues object. For example:
Copy code
json
{
  "assistantId": "your-assistant-id",
  "assistantOverrides": {
    "variableValues": {
      "userId": "12345",
      "status": "active"
    }
  },
  "customer": {
    "number": "+1xxxxxxxxxx"
  },
  "phoneNumberId": "your-phone-id"
}
Then, in your API Request node, use these variables in the queryParameters section like so:
"param1": "{{userId}}"
. This will ensure the values are dynamically inserted during the workflow execution. [Source: Vapi.ai documentation on dynamic variables](https://docs.vapi.ai/assistants/dynamic-variables) Source: - [Vapi.ai documentation on dynamic variables](https://docs.vapi.ai/assistants/dynamic-variables)
k
Define variables in previous nodes like userId or status, then reference them in the API Request node using double curly braces e.g {{userId}}, ensuring the variables are set before the API call is made..
e
It’s said an error occurred. I can debug the reason?
"name": "node_11", "type": "apiRequest", "metadata": { "position": { "x": -441.3372681417609, "y": 810.2266936475797 } }, "method": "GET", "url": "https://www.www.www/api/buildings/123123/residents?name={{resident_name}}&apartment={{resident_apartment}}", "headers": { "type": "object", "properties": {} }, "body": { "type": "object", "properties": {} }, "output": { "type": "object", "properties": { "samePerson": { "type": "string", "description": "", "target": "samePerson" }, "foundApartment": { "type": "string", "description": "", "target": "foundApartment" }, "residentId": { "type": "string", "description": "", "target": "residentId" } } }, "mode": "blocking", "hooks": [] },
This is how I defined the workflow. Also defined the variables. What I’m doing wring?
k
Ensure resident_name and resident_apartment are defined before the API request, headers are set if needed, output fields match the API response structure, and check logs for errors.
e
How do I check the logs? The console is empty
v
Hey, Could you please schedule a brief call at your convenience so we can discuss this matter in detail? Kindly use the following link to book a suitable time: .
4 Views