Search code examples
bot-framework-composer

Serving a HTTP request response as a dialog response - Composer Framework


We are developing a chatbot to handle internal and external processes for a local authority. We are trying to display contact information for a particular service from our api endpoint. The HTTP request is successful and delivers, in part, exactly what we want but there's still some unnecessary noise we can't exclude.

We specifically just want the text out of the response ("Response").

Logically, it was thought all we need to do is drill down into ${dialog.api_response.content.Response} but that fails the HTTP request and ${x.content} returns successful but includes Tags, response and the fields within 1.

Is there something simple we've missed using composer to access what we're after or do we need to change the way our endpoint is responding 2? Unfortunately the MS documentation for FrwrkComp is lacking to say the very least.

n.b. The response is currently set up as a (syntactically) SSML response, this is just a test case using an existing resource.

Response in the Emulator Snippet from FwrkComp


Solution

  • Turns out it was the first thing I tried just syntactically correct. For the case of the code given it was as simple as:

    ${dialog.api_response.content[0].Response}