other-emerald•9mo ago
Event triggering approach ?
Hi lovely people 😉
I'm trying to do a test to trigger an Event, I have defined an event in the VF CMS.
I read the documentation https://docs.voiceflow.com/docs/using-the-events-cms , specifically the section A. Invoking Events via the API (it seems there are 2 ways to trigger a VF event, I would like to use the A's way through a VF rest api).
Just to test this, I have an step in my workflow that does a call to the VF API, and I passed there the even't information as stated in the documentation, I expected after the call my event is been triggered and the path tied to the event is executed, but nothing happened there:
In the image attached in the workflow, I expect on the "step 2" (The api call POST: https://general-runtime.voiceflow.com/state/user/
{user_id} ) passing in the body :
{
"action": {
"type": "event",
"payload":{
"event": {
"name": "NameOfMyEvent"
}
}
}
}
The api call is successful, it return an empty array with 201 http status code, but the path with my event "Step 3 in the attached image" has never initiated.
Am I missing something ??
Thanks in advance!
8 Replies
To trigger an event using the Voiceflow API, ensure that you have correctly set up your event in the Voiceflow CMS and that your API call is accurately formatted. Here are some steps to troubleshoot and ensure everything is set up correctly:
1. Verify Event Setup: Double-check that the event "NameOfMyEvent" is correctly defined in the Voiceflow CMS. Ensure that it is linked to the appropriate path in your workflow.
2. API Call Structure: Your API call seems correctly structured. Ensure that the
user_id
in the URL is correct and corresponds to the user session you are testing with.
3. Check API Response: Since the API call is successful, check the response to see if there are any warnings or additional information that might indicate why the event isn't triggering.
4. Workflow Configuration: Ensure that the workflow is correctly configured to listen for the event. The event should be properly linked to the subsequent steps in the workflow.
5. Debugging: Use logging or debugging tools to check if the event is being received by the workflow. This can help identify if the issue is with the event triggering or with the workflow execution.
If all these steps are correctly followed and the issue persists, it might be helpful to review the workflow and event setup for any overlooked details.DM me about your API question
other-emeraldOP•9mo ago
Any help on this will be really appreciated, thanks in advance!
Is there anyone that have used events before ? (through the Rest Api , not the Webchat approach ... )
xenial-black•9mo ago
I am still having trouble with events, they don't seem to work for me.
I am using the API and my payload is :
{
"action": {
"payload": {
"event": {
"name": "main_menu"
}
},
"type": "event"
},
"config": {
"excludeTypes": [
"block",
"debug",
"flow"
],
"stopAll": false,
"stripSSML": true,
"tts": false
}
}
I have it working perfectly
foreign-sapphire•8mo ago
@AlexFPV any luck setting this up? I am having trouble as well...
deep-jade•6mo ago
Has this issue been fixed? I'm running into the exact same problem here.
Invoking event through Javascript works.
But when I try to trigger it via API I get a 201 back where nothing happens in the webchat widget.
Here's the request I send:
With the following response:
Anyone get this working? I'm posting same as above as @idmon , though going to the /interact endpoint. I just get an empty array back. @W. Williams (SFT) if you have a working approach can you share in the chat for others to benefit?