Tropo WebAPI Development Guide Home  |  Frameset Home


{"result":}  object


Returned anytime a request is made to the Tropo Web API, as exemplified by this brief call flow:

  1. User calls a Tropo WebAPI application.
  2. Tropo sends session JSON to defined web server, requesting instructions.
  3. Web server application responds with JSON requesting Tropo ask the caller a question.
  4. Tropo asks the question, user responds.
  5. Tropo sends result JSON back to the web server with the user's answer.

Result is not limited to use in an "ask", the above is just one example. Note that any encoded data, like accented characters, will be passed to your app as ISO-8859-1 encoded in the JSON.


usage

{ "result": {
    "actions": Array or Object,
    "callId": String,
    "complete": Boolean,
    "error": String,
    "sequence": Integer,
    "sessionDuration": Integer,
    "sessionId": String,
    "state": String } }


fields

actions Data Type: Array or Object Default: (none) Optional
Actions contains either an Array or an Object with the result of the actions requested in the previous payload, such as an ask or record. The field will be an array if multiple inputs were requested, an object if only one input was requested. Contains the following keys:

  • "name" [String] - The name provided for this action result in the request.
  • "attempts" [Integer] - The number of attempts it took to obtain the result.
  • "disposition" [String] - The final result of the request, values may be "success", "timeout" or "nomatch".
  • "confidence" [Integer] - The result returned by the confidence engine that the result is correct.
  • "interpretation" [String] - What the recognition engine believes what was said.
  • "utterrance" [String] - The specific utterance returned by the speech recognition engine.
  • "value" [String] - This is the result of the grammar. If you have a grammar that says "BBQ (BBQ, Bar Bee Que)" and someone says "Bar Bee Que", then interpretation would say "Bar Bee Que" and value would say "BBQ".
  • "concept" [String] - The result of a Simple Grammar recognition.
  • "xml" [String] - Contains the raw NLSML output.

  • When an Object:

"actions": { "name": "account_number", "attempts": 1, "disposition": "SUCCESS", "confidence": 100, "interpretation": "12345", "utterance": "1 2 3 4 5", "concept": "12345" }


  • When an Array:

"actions": [{ "name": "account_number", "attempts": 1, "disposition": "SUCCESS", "confidence": 100, "interpretation": "12345", "utterance": "1 2 3 4 5", "concept": "12345" }, { "name": "pin", "attempts": 1, "disposition": "SUCCESS", "confidence": 100, "interpretation": "9876", "utterance": "9 8 7 6", "concept": "9876" }]
callId Data Type: String Default: "" (undefined) Optional
This contains the ID of the call itself; this is not the caller ID or called ID, this is a value that identifies the actual call.
complete Data Type: Boolean Default: (none) Optional
This indicates whether a request resulted in all required fields being completed.
error Data Type: String Default: "" (undefined) Optional
If the state of the result is an error, refer to this field for the error message.
sequence Data Type: Integer Default: 0 Optional
Represents the number of Tropo payloads returned from your application. For example, if your application receives a session payload and returns a Tropo payload such as an ask, the sequence is at 1. If you then receive a result from Tropo and return a say, the sequence is at 2.
sessionDuration Data Type: Integer Default: 0 Optional
The total length of time, in seconds, the current session has been running.
sessionId Data Type: String Default: "" (undefined) Optional
This is the unique identifier that is available with each session and result payload.
state Data Type: String Default: "" (undefined) Optional
This is the state of the session at the time the result was generated. Values may be: NEW, RINGING, ANSWERING, ANSWERED, REJECTING, REJECTED, DISCONNECTED, FAILED, REDIRECTING, or REDIRECTED.



code samples

Example
{
   "result":{
      "actions":{
         "attempts":1,
         "concept":"1",
         "confidence":100,
         "disposition":"SUCCESS",
         "interpretation":"1",
         "name":"foo",
         "utterance":"1",
         "value":"1",
         "xml":"<?xml version=\"1.0\"?>\r\n<result grammar=\"0@298fe168.vxmlgrammar\">\r\n    
<interpretation grammar=\"0@298fe168.vxmlgrammar\" confidence=\"100\">\r\n        \r\n      
<input mode=\"dtmf\">dtmf-1<\/input>\r\n    <\/interpretation>\r\n<\/result>\r\n"
      },
      "callId":"b024c5d47ce0d8ffc6c258e7cf2ed4a2",
      "complete":true,
      "error":null,
      "sequence":1,
      "sessionDuration":11,
      "sessionId":"b3bcf051b985c1f3003f746e4e2ffe1c",
      "state":"ANSWERED"
   }
}



additional links

none


  ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page

login



© 2012 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site