plain-purple
plain-purple2y ago

API Response Capture

Hello! Can someone help me format the capture response to collect line 15 "date"? I've tried VF_HEADERS.date, and response.VF_HEADERS.date, response.result.VF_HEADERS.date My variable stays 0.
No description
9 Replies
xenophobic-harlequin
xenophobic-harlequin2y ago
Just response.date
exotic-emerald
exotic-emerald2y ago
Probably won't work i guess. Because it's in a header and not body.
plain-purple
plain-purpleOP2y ago
That makes sense - thanks!
exotic-emerald
exotic-emerald2y ago
But what are you trying to do exactly?
plain-purple
plain-purpleOP2y ago
I was just looking to update a variable with current date. I just found https://worldtimeapi.org/ which does it. I know this can be done directly in voiceflow, but I am not a javascript guy.
exotic-emerald
exotic-emerald2y ago
Your response should be something like this { "abbreviation": "IST", "client_ip": "103.78.20.166", "datetime": "2024-01-28T20:03:28.901851+05:30", "day_of_week": 0, "day_of_year": 28, "dst": false, "dst_from": null, "dst_offset": 0, "dst_until": null, "raw_offset": 19800, "timezone": "Asia/Kolkata", "unixtime": 1706452408, "utc_datetime": "2024-01-28T14:33:28.901851+00:00", "utc_offset": "+05:30", "week_number": 4 } Then you probably want to capture the 3rd line using "response.datetime"
plain-purple
plain-purpleOP2y ago
Yes! I tried capturing "response.datetime" and it works well. Thank you!
exotic-emerald
exotic-emerald2y ago
No problem. Though you solved it on your own. Keep going 👍
plain-purple
plain-purpleOP2y ago
Thank you again! Sometimes this stuff baffles me!

Did you find this page helpful?