Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Need example for /v6/tools/messageResponders with Multiple Responses

Can you post an example or two for /v6/tools/messageResponders with Multiple Responses? Thanks. JT

Comments

  • williammccusker
    williammccusker Posts: 672 ✭✭✭

    Hi,
    Here is a sample example over the response part for multiple responses. The api doesn't support all the configuration options that are in the UI for multiple responses. You could instead create multiple responders with response correlation rather than one in multiple responses with many different conditions.

    "response": {
    "inputMode": "multipleResponses",
    "literal": {
    "text": "your-message",
    "type": "text",
    "mimeType": "text/xml"
    }
    }

  • jefftuckerbofa
    jefftuckerbofa Posts: 234

    Thanks for the quick reply. Yeah, I wasn't seeing the additional correlation options that are there in the UI. I'll create multiple responders with expanded correlation. JT

  • jefftuckerbofa
    jefftuckerbofa Posts: 234

    Had a question about the REST call /v6/tools/dbTools I want to create a dbTool as a child of a messageResponder. I noticed that the parentId needs to be either a suite or an outputProvider. So, I guess the issue is how to add an outputProvider to a messageResponder using the REST API. Thanks. JT

  • williammccusker
    williammccusker Posts: 672 ✭✭✭

    Hi,

    An example id for an output provider would be like this

    /VirtualAssets/assetName.pva/Responder Suite/ResponderName/Incoming Request/DB Tool

    The "output provider" location in this case is to a DB Tool chained to the "Incoming Request." An easy way to get an idea of what the output providers name would be is add the tool in the desktop to a responder and look at the name in the "Virtual Asset Explorer." Also using the REST API to do a get on

    /tools/messageResponders

    To the responder id and in the "relationships" it will provider the id to the chained output providers.

  • jefftuckerbofa
    jefftuckerbofa Posts: 234

    Works perfectly. Thanks! JT

  • williammccusker
    williammccusker Posts: 672 ✭✭✭

    Glad to hear it worked!

  • jefftuckerbofa
    jefftuckerbofa Posts: 234

    Could you post a request payload for the create dbTool call that uses a parameterized query? Thanks! JT

  • jefftuckerbofa
    jefftuckerbofa Posts: 234

    an payload with data as an example

  • williammccusker
    williammccusker Posts: 672 ✭✭✭

    Hi,

    Here is an example request payload for a db tool request that uses a variable for the sql query. The variable could from a data source or a data bank or a suite variable. There may be some optional fields that were included that you don't have to send.

    The easy way to get an idea of how to build a request to the REST API to configure a tool is to create the tool in the desktop and then use the REST API to execute a GET to that tool. The create and update request should be the same as the response that is returned.

    Also in case you didn't know there is a UI to the REST API that can be accessed at http://:/soavirt/api that makes testing POST/PUT/GET requests easy.

    Hope this helps!

  • jefftuckerbofa
    jefftuckerbofa Posts: 234

    Ahh I think I misunderstood the API. I was thinking parameterized was relating to a prepared statement ( insert into TABLE (col1, col2, col3) values (?, ?, ?) ) I see now that it relates to the actual SQL being dynamic. Thanks for the input. I really appreciate how quickly you respond with very useful info. JT

  • williammccusker
    williammccusker Posts: 672 ✭✭✭

    Happy to help!