API passing wrong date
# support
e
Hello, I set up VAPI and got it working at first but now it seems to not work every single time. and upon reviewing the make no matter what i try to say to vapi for booking an appointments, tomorrow, thursday, it sends a date of 2023-october and some date. so my make integration is not working, is it just me and is there some way to reset and/or fix this?
v
@Eric Chong | HSFM Hello! I'm glad to hear you got VAPI working initially, but I'm sorry to hear you're experiencing inconsistencies now. It sounds like there might be an issue with the date parsing within your integration. Here are a few steps you can take to troubleshoot and potentially resolve the issue: 1. Check Your Date Parsing Logic: Review the part of your code or integration that handles date extraction from the user's speech. Ensure that it's correctly interpreting the dates and not defaulting to October for some reason. 2. Review Logs: If your system keeps logs, check them for any errors or warnings that occur when the system tries to parse dates. This might give you insight into what's going wrong. 3. Update Your Models: If you're using any machine learning models for date parsing, make sure they are up to date and trained on relevant data. 4. Reset Your Integration: If you have the option to reset or reinitialize your integration, doing so might clear any temporary issues. 5. Contact Support: If you've tried these steps and are still facing issues, it might be best to reach out to the support team for more personalized assistance. You can email them at [support@vapi.ai](support@vapi.ai). If you'd like, I can assist you in sending an email to the support team to get more help on this issue. Would you like me to do that for you?
You can continue this conversation by mentioning me in the message.
e
Attempting to set up your VAPI system and got it working and successfully booked the first time but have been getting errors ever sinde and i thought it was my problem but it seems like theres a weird error on my account causing the API to pass a date through thats a year old, so i book for tomorrow but the value that comes through is october 2023, can you help to reset and/or look into my account? assistant ID: 218781a4-fe50-4ffe-ab47-5def64e93ba4 tool ID: 83033b43-4d45-4934-be5d-75abd97a56e1
s
Hey @Eric Chong | HSFM 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 me figure out what went wrong!
e
timestamp 1732076781353 CallID af287080-a0b2-4be4-9e23-f7d3ec436905 I expected to get 'tomorrow at 9:30' (which is today) It sent: argumentsCollection timeZone America/Los_Angeles appointmentTime 2023-11-01T09:30:00 Bundle 1Collection messageCollection timestamp 1732076781353 type tool-calls toolCallsArray toolCallListArray toolWithToolCallListArray 1Collection type make functionCollection async false serverCollection messagesArray toolCallCollection id call_6sw0c3ht0WZ0OQcotbqZQJH3 type function functionCollection name ghlBooking argumentsCollection timeZone America/Los_Angeles appointmentTime 2023-11-01T09:30:00
s
@Eric Chong | HSFM you are not including the variables required to fill current date and time in the assistant to get the current date and time do check this doc section
advanced-date-and-time-usage
https://docs.vapi.ai/assistants/dynamic-variables#advanced-date-and-time-usage. Do let me know if you face any difficulty or require further help.
e
I've tried adding this but its giving me an error: DataError Error: 400 Bad Request {"message":"Unexpected non-whitespace character after JSON at position 243 (line 13 column 1)","error":"Bad Request","statusCode":400} Origin HTTP Automatic error handler If you want to handle this error automatically, choose one of the following options. This will create a new error-handler route in your scenario. You can then expand the route in any way you like. { "assistantId": "218781a4-fe50-4ffe-ab47-5def64e93ba4", "phoneNumberId": "ebb4d96a-1903-418e-b67f-e5da72464653", "customer": { "number": "{{1.phone}}", "name": "{{1.first_name}}" }, "metadata": { "referredBy": "{{1.
Referred By
}}" } } {{{{now}} | date: "%b %d, %Y, %I:%M %p", "{{1.timezone}}"}} https://cdn.discordapp.com/attachments/1308650480821338123/1309372552753188904/image.png?ex=674157b7&is=67400637&hm=a9fefab49a3ed6166485f80a562d46d244cdd2853df34ef8ebd060ecb8511003&
also, what is the best practice for this, am i doing this right or is there a better way?
so im wanting to make a dialer that can book appointments, im in california and many of our calls are there, btu some are in other timezones, is it best to send the contact's timezone through with the vapi request?
also I've tried using the instructions, but ive also tried chat GPT, when i copy and paste that into make.com's content section is changes the input from {{"now" | date:}}%b %d, %Y, %I:%M %pAmerica/New_York to the screenshot, so im not sure if thats why im getting the error, but right now this is what i have and its not getting through: { "assistantId": "218781a4-fe50-4ffe-ab47-5def64e93ba4", "phoneNumberId": "ebb4d96a-1903-418e-b67f-e5da72464653", "customer": { "number": "{{1.phone}}", "name": "{{1.first_name}}" }, "metadata": { "referredBy": "{{1.customData.referredBy}}{{""" }, ""appointmentTime"": ""now" | date:}}%Y-%m-%dT%H:%M:%SAmerica/Los_Angeles" } https://cdn.discordapp.com/attachments/1308650480821338123/1309378513538650133/Snag_2e7c035.png?ex=67415d44&is=67400bc4&hm=5271db477a37ff9e671f7bad0f1f3a742ebe82be0c386dd7c29a57042b8422cf&
s
You don't need to pass
""appointmentTime"": ""now" | date:}}%Y-%m-%dT%H:%M:%SAmerica/Los_Angeles"
inside your prompt as visible in the docs.
Because of this your getting the JSON error. Do let me know how it goes post making the changes.
e
Yes, I understand what you are saying but I've attempted to, and I'm getting the error above, can you tell me how it needs to be formatted?do you know how this needs to be formatted
what are the best practices for sending number name, meta data of referred by and timezone through the system
okay, i asked make also and they said: Hi Eric, Thank you so much that you've chosen to connect with us. My name is Hanna and I'm happy to assist you with your ticket and ensure you receive the best possible care. I am so sorry for any inconvenience you experienced! The issue occurs because Make automatically interprets double curly brackets
{{
as variables, which alters the formatting of your request. To send the correct request to VAPI, I recommend using the toString() function for both opening and closing curly brackets, as shown in the screenshot below: ​{{toString("{{")}}"now" | date: "%b %d, %Y, %I:%M %p", "America/New_York"{{toString("}}")}} This approach ensures that the curly brackets are treated as plain text rather than variables, allowing the rest of the required code to remain intact. Hope it helps! I've tried in all three locations and its still not passing, so make it sending the request but its seems its giving an error. https://cdn.discordapp.com/attachments/1308650480821338123/1309728919812833290/Snag_7e28082.png?ex=6742a39c&is=6741521c&hm=c9c6142dbcd513e5124566b729b1763a9d433190ba30ef23db7daff614887b05& https://cdn.discordapp.com/attachments/1308650480821338123/1309728920018485308/Snag_7e287c6.png?ex=6742a39c&is=6741521c&hm=f8ad5f10c1ed84eb042358dd2acf520dcc4cf897c16db33db544ac83b41b3a60& https://cdn.discordapp.com/attachments/1308650480821338123/1309728920328736768/Snag_7e29090.png?ex=6742a39c&is=6741521c&hm=bea19b96205d0d3673a004e77efb56d07b938aa7629094e1d810ff7199941fd4&
do you mind showing me how you correctly send the request?
s
@Eric Chong | HSFM heres' the curl for creating and using defualt dynamic variables. Now coming to using with make you have to pass them as type of string only. Do let me know if you have more doubts. *FYI: * Make is correct about
toString
Copy code
curl -X POST https://api.vapi.ai/call \
     -H "Authorization: Bearer token-here" \
     -H "Content-Type: application/json" \
     -d '{
  "assistantId": "insert-assistant-id-here",
  "assistantOverrides": {
    "variableValues": {
      "currentDateTimeInUTC": "{{\"now\" | date: \"%b %d, %Y, %I:%M %p\", \"America/New_York\"}}"
    },
    "metadata": {
      "referredBy": "<insert-refered-by-here> {{\"now\" | date: \"%b %d, %Y, %I:%M %p\", \"America/New_York\"}}\n"
    }
  },
  "phoneNumberId": "insert-phone-number-id-here",
  "customer": {
    "numberE164CheckEnabled": false,
    "number": "insert-customer-number-here",
    "name": "insert-customer-name-here"
  }
}'
j
hello brother, did you manage to fix this issue?
s
@Eric Chong | HSFM closing this ticket because of no response.
9 Views