JSON API » ivrs » ivrs/events/list
Gets the fields of IVR events for a specified IVR menu, or for all IVR menus in a specified customer. These have only been collected if the IVR menu or menus have been set to do so.
Input parameters
Requires authentication and the user role privilege if an IVR menu is specified, or the administrator role privilege if a customer is specified.
| Name | Type | Description | Required | Default value |
|---|---|---|---|---|
| auth_username | String | Authentication username. | Yes | |
| auth_password | String | Authentication password. | Yes | |
| archive | Integer | 1 to include archived entries, 0 not to. | No | 0 |
| customer | Integer | ID of customer to get events for all IVR menus. | Yes, unless ivr is specified. | None |
| ivr | Integer | ID of IVR menu to get events for. | Yes, unless customer is specified. | None |
| start | Integer | Start Unix timestamp. -1 for the last time this function was called for the IVR menu or menus. | No | -1 |
| end | Integer | End Unix timestamp. -1 for one second ago. | No | -1 |
If a customer and start=-1 are both specified, each IVR menu uses its individual last time the function was called.
Responses
| Code | Description |
|---|---|
| 200 | Success. |
| 400 | Invalid input parameters specified. Check the key and message fields for more details. |
| 401 | The authentication details provided are invalid. |
| 402 | Your role does not allow this. |
| 404 | The IVR menu or customer does not exist, or you do not have permission to view it. |
Data returned
An array of fields, corresponding to the recorded IVR events. Each entry's data field is a pipe-delimited string in the format: Unix timestamp, callid, IVR menu name, Asterisk channel, event, key press, goal.
Events are one of: IVRSTART when a call enters the IVR menu, IVRAPPEND when the caller presses a key or the menu times out (key press "t"), IVRGOAL when the caller reaches a destination with a goal name set, and IVRHANGUP when the call hangs up while in the IVR menu.
Example: With ivr (data truncated for brevity)
http://enswitch.example.com/api/json/ivrs/events/list/?auth_username=user;auth_password=password;ivr=123{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "data":"1234567890|1234567890.1|example ivr|PJSIP/example-00000001|IVRSTART||" }, { "data":"1234567891|1234567890.1|example ivr|PJSIP/example-00000001|IVRAPPEND|1|" } ] }
Change history
| Version | Changes |
|---|---|
| 4.4 | Function added. |
