make.com Vapi api call, content breaks when using ...
# support
e
Hey yall, in make.com when trying to make a call using the http module, whenever i use a vairable for the api call content, it breaks and i get a 400 error, anyone know the fix? "content": "{{replace(3.System prompt + " The current date and time is: " + now + "."; """"; emptystring)}}",
v
@Eliminator Hello! It seems like there might be an issue with the way the content is being formatted in your make.com scenario. When using variables and concatenating strings, it's important to ensure that the syntax is correct and that any special characters are properly escaped. In the content you've provided, there appears to be a syntax error with the quotation marks. The
replace
function is being used, but the double quotes inside the string are not escaped, which could be causing the problem. Additionally,
emptystring
should be a string value, like
""
. Here's a corrected version of the content field:
Copy code
json
"content": "{{replace(3.System prompt + ' The current date and time is: ' + now + '.'; '\"'; '')}}"
In this corrected version, I've changed the outer double quotes to single quotes to avoid confusion with the inner double quotes that are part of the string you want to replace. Also, I've replaced
emptystring
with
''
to represent an empty string. If you're still encountering issues, please ensure that the variables
3.System prompt
and
now
are correctly defined and that their values are what you expect them to be. If the problem persists, you may want to reach out to make.com support for more specific assistance with your scenario.
You can continue this conversation by mentioning me in the message.
e
this does nto work either ""content": "{{3.
System prompt
}}""
"messages": [ { "content": "You are an AI phone assistant representing Jeff from Prestige Properties. ​" "role": "system"
this is the output
l
I can help you out with this
s
try asking make support, this is something we cannot help with.