Tropo is part of CiscoLearn More

result

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.

The Result object is sent to your server with the UTF-8 character encoding.

Fields

actions

Array or Object

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. See the Actions object later on this page for a description of all fields.

Example of an object:

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

Example of 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

String

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.

Example: "callId":"8986b9d9252c0b0ea6acf76fdb212345",

calledID

String
Default: 
none

On outgoing calls (either with a call or transfer), the calledID will be set to the number called. In the case of multiple numbers called at once, calledID will indicate which number answered.

Example: "calledid":"+14075550100",

complete

Boolean

This indicates whether a request resulted in all required fields being completed.

Example: "complete":true,

error

String

If the state of the result is an error, refer to this field for the error message. Will be null if there is no error.

Example: "error":null,

sequence

Integer
Default: 
0

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.

Example: "sequence":1,

duration

Integer
Default: 
0

Set on a transfer only, the total duration in seconds of a transferred call, including the time spent ringing before the call was answered.

Example: "duration":11,

connectedDuration

Integer
Default: 
0

Set on a transfer only, the duration in seconds of a transferred call, starting from when the destination leg answers.

Example: "connectedDuration":8,

sessionDuration

Integer
Default: 
0

The total length of time, in seconds, the current session has been running.

Example: "sessionDuration":12,

sessionId

String

This is the unique identifier that is available with each session and result payload.

Example: "sessionId":"be9610c12d60ae8c99f0fbf554212345",

state

String

This is the state of the session at the time the result was generated. Values may be: ANSWERED, ANSWEREDWITHEARLYMEDIA, DISCONNECTED, REJECTED, REDIRECTED, or FAILED.

Most states are self-explanatory, but ANSWEREDWITHEARLYMEDIA may not be. If answerOnMedia is enabled on an outgoing call, this indicates that the call was answered because audio was heard.

Example: "state":"ANSWERED",

Actions Object Fields

The actions object contains the results of any actions that users took from the previous session object.

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, FAILED, EXTERNAL_EVENT, TIMEOUT, BUSY, or REJECTED

confidence

Integer

The result returned by the confidence engine that the result is correct.

interpretation

String

What the recognition engine believes what was said.

utterance

String

The specific utterance returned by the speech recognition engine. 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".

value

String

For speech recognition actions, 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".

For recording actions, this is the URL to the temporary copy of the recording before Tropo pushes it to your server. You can use this to play back a recording before the upload is completed. Tropo deletes the temporary copy when the call ends.

concept

String

The result of a Simple Grammar recognition. If you have a grammar that says "BBQ (BBQ, Bar Bee Que)" and someone says "Bar Bee Que", concept would be "BBQ".

xml

String

Contains the raw NLSML output from the speech recognition engine. This is mostly useful when asking Tropo to troubleshoot recognition issues.

uploadStatus

String

If the action is a Tropo "record" or a "stopCallRecording" this field will be present. Indicates if the upload to your server or S3 bucket succeeded. Possible values are success if it worked, error if it did not work, no_audio_collected if the caller hung up before recording or had a muted microphone during recording, or null if asyncUpload was enabled, preventing Tropo from knowing the upload status at the time the Result document was generated.

Returns

value

Examples

Example of result JSON for an inbound ask

{
   "result":{
      "sessionId":"f4140488a0036e725e112f4c74c12345",
      "callId":"9a9cd46c961fc631068557eb7b812345",
      "userType":"NONE",
      "state":"ANSWERED",
      "sessionDuration":6,
      "sequence":1,
      "complete":true,
      "error":null,
      "calledid":"14075550100",
      "actions":{
         "name":"color",
         "attempts":1,
         "disposition":"SUCCESS",
         "confidence":46,
         "interpretation":"blue",
         "utterance":"blue",
         "concept":"blue",
         "value":"blue",
         "xml":"<?xml version=\\\\"         1.0         \\\\"?>\\\\r\\\\n<result grammar=\\\\"0@dde9c50f.vxmlgrammar\\\\">\\\\r\\\\n    <interpretation grammar=\\\\"0@dde9c50f.vxmlgrammar\\\\" confidence=\\\\"46\\\\">\\\\r\\\\n        \\\\r\\\\n      <input mode=\\\\"speech\\\\">blue<\\\\/input>\\\\r\\\\n    <\\\\/interpretation>\\\\r\\\\n<\\\\/result>\\\\r\\\\n"
      }
   }
}
{
   "result":{
      "sessionId":"be9610c12d60ae8c99f0fbf554212345",
      "callId":"8986b9d9252c0b0ea6acf76fdb212345",
      "userType":"NONE",
      "state":"ANSWERED",
      "sessionDuration":12,
      "sequence":1,
      "complete":true,
      "error":null,
      "calledid":"+14075550100",
      "_call":{
         "sessionId":"be9610c12d60ae8c99f0fbf554212345",
         "callId":"8986b9d9252c0b0ea6acf76fdb212345",
         "userType":"NONE",
         "state":"ANSWERED",
         "sessionDuration":12,
         "sequence":1,
         "complete":true,
         "error":null,
         "calledid":"+14075550100"
      },
      "actions":[
         {
            "name":"call-bf1c3e59-7779-422a-b0d1-f43f01212345",
            "sessionId":"be9610c12d60ae8c99f0fbf554212345",
            "callId":"8986b9d9252c0b0ea6acf76fdb212345",
            "userType":"NONE",
            "state":"ANSWERED",
            "sessionDuration":12,
            "sequence":1,
            "complete":true,
            "error":null,
            "calledid":"+14075550100",
            "_call":{
               "sessionId":"be9610c12d60ae8c99f0fbf554212345",
               "callId":"8986b9d9252c0b0ea6acf76fdb212345",
               "userType":"NONE",
               "state":"ANSWERED",
               "sessionDuration":12,
               "sequence":1,
               "complete":true,
               "error":null,
               "calledid":"+14075550100"
            }
         },
         {
            "name":"color",
            "attempts":1,
            "disposition":"SUCCESS",
            "confidence":33,
            "interpretation":"blue",
            "utterance":"blue",
            "concept":"blue",
            "value":"blue",
            "xml":"<?xml version=\\\\"            1.0            \\\\"?>\\\\r\\\\n<result grammar=\\\\"0@23806e29.vxmlgrammar\\\\">\\\\r\\\\n    <interpretation grammar=\\\\"0@23806e29.vxmlgrammar\\\\" confidence=\\\\"33\\\\">\\\\r\\\\n        \\\\r\\\\n      <input mode=\\\\"speech\\\\">blue<\\\\/input>\\\\r\\\\n    <\\\\/interpretation>\\\\r\\\\n<\\\\/result>\\\\r\\\\n"
         }
      ]
   }
}
{
    "result": {
        "sessionId": "863ec8a756fe3b10dac6b6d1f6712345",
        "callId": "ee0d0f9f33d876ead7d33c1395612345",
        "userType": "HUMAN",
        "state": "ANSWERED",
        "sessionDuration": 34,
        "sequence": 1,
        "complete": true,
        "error": null,
        "calledid": "+14075550100",
        "_call": {
            "sessionId": "863ec8a756fe3b10dac6b6d1f6712345",
            "callId": "ee0d0f9f33d876ead7d33c1395612345",
            "userType": "HUMAN",
            "state": "ANSWERED",
            "sessionDuration": 34,
            "sequence": 1,
            "complete": true,
            "error": null,
            "calledid": "+14075550100"
        },
        "actions": [
            {
                "name": "call-8cdf73ea-40da-47c4-a040-b2b814e12345",
                "sessionId": "863ec8a756fe3b10dac6b6d1f6712345",
                "callId": "ee0d0f9f33d876ead7d33c1395612345",
                "userType": "HUMAN",
                "state": "ANSWERED",
                "sessionDuration": 34,
                "sequence": 1,
                "complete": true,
                "error": null,
                "calledid": "+14075550100",
                "_call": {
                    "sessionId": "863ec8a756fe3b10dac6b6d1f6712345",
                    "callId": "ee0d0f9f33d876ead7d33c1395612345",
                    "userType": "HUMAN",
                    "state": "ANSWERED",
                    "sessionDuration": 34,
                    "sequence": 1,
                    "complete": true,
                    "error": null,
                    "calledid": "+14075550100"
                }
            },
            {
                "name": "color",
                "attempts": 1,
                "disposition": "SUCCESS",
                "confidence": 59,
                "interpretation": "blue",
                "utterance": "blue",
                "concept": "blue",
                "value": "blue",
                "xml": "<?xml version=\\\\"1.0\\\\"?>\\\\r\\\\n<result grammar=\\\\"0@37c12891.vxmlgrammar\\\\">\\\\r\\\\n    <interpretation grammar=\\\\"0@37c12891.vxmlgrammar\\\\" confidence=\\\\"59\\\\">\\\\r\\\\n        \\\\r\\\\n      <input mode=\\\\"speech\\\\">blue<\\\\/input>\\\\r\\\\n    <\\\\/interpretation>\\\\r\\\\n<\\\\/result>\\\\r\\\\n"
            }
        ]
    }
}