0

JSON produced by Node / Java SDKs not recognised

Hi,

Having a few issues where the SDKs for Node and Java sometimes don't produce the JSON that Tropo actually needs.

To give one example using the Node.js web API lib in Express:

var tropo = new TropoWebAPI();

tropo.call("+123456789");

tropo.say("you have answered the phone");

Produces:

{

  "tropo": [

    {

      "call": {

        "to": "+123456789"

      }

    },

    {

      "say": {

        "value": "you have answered the phone"

      }

    }

  ]

}

But this response doesnt trigger a call - as Tropo seems to require [ ] around the Say elements. If these brackets are added to the output manually then it works fine, eg

var jsonToSend =

{

"tropo":[

{

"call":{

"to":"+123456789"

}

},

{

"say":[

{

"value":"Incoming call"

}

]

}

]

};

res.send(jsonToSend);

*Noticed several other examples too.  Can work round these issues by composing the JSON manually but just wondered if there is a fix planned, or more uptodate libraries than those desribed in the current docs? *

Thanks :)

1 comment

Please sign in to leave a comment.