Starting with release 9, Voicent will offer JSON POST support throughout IVR Studio. The steps below will show you how to take advantage of a JSON.
First, select your parent element in IVR Studio, for an Incoming Call it will be the ‘Incoming Call’ element.
For BroadcastByPhone it will be ‘BBP Outbound Call’.
For AgentDialer it will be ‘AgentDialer Outbound Call’.
After you select the parent node/element, navigate to the ‘Variable’ tab of the properties after you right click it. On the ‘Variable’ tab, select ‘New…’ and give your JSON Variable a name, in this article we will name it ‘jsonresponse’, and for the ‘Value Expression’ give it the name of ‘jsoninit()’ to let IVR Studio know that will be a JSON variable. Hit ‘OK’ to save this variable, and ‘OK’ again to save the Root Elements properties.
To do the actually JSON post, you will need to design the IVR Studio flow, then at the desired element you want to JSON post to, right click and select ‘Properties’. Inside the properties, go to the ‘Action’ tab and select ‘New’, select the ‘Submit HTTP Request’ radio button and hit ‘OK’.
Give your action a name, a URL and the desired POST information. Make sure to select ‘Response is in JSON format’ at the bottom left. Once the action is filled out, select ‘OK’. Write the action name down.
Create a new action, select ‘Set Variable Value’ select the json variable we created at the parent element. With that parent element, set the value expression to the action name.
{
“response”: {
“DATA”: “2013081051″
}
}
To access the response item you need to use ‘action name’.'response field’.
For our example is would be jsonresponse.response.data to access the information in the JSON response.