Forum Discussion

Manojaj's avatar
Manojaj
New Contributor
2 years ago

Groovy script for dynamic response in Readyapi

Our scope of need is to get a dynamic response if the user hits the API request incorrectly and they need to get different response. I have created in readyapi rest, soap, and jdbc protocols with static responses when the user wants to access the response, but when the user requests with payload incorrectly example ( wrong I'd -xxxxx) , they receive the same response from readyAPI. I would like to create script to handle dynamic response; could you please share an example?
  • Manojaj's avatar
    Manojaj
    New Contributor

    In my project, I created static responses that are actual database responses. If I requested negative with the wrong input parameter, I received a different response, so order by which I want to create groovy script