Lisa-test-invoke API doesn't provide the plain text response
search cancel

Lisa-test-invoke API doesn't provide the plain text response


Article ID: 226750


Updated On:


CA Application Test


The Lisa invoke API  call gives encoded response instead of the plain text response. Is there a way to see the plain text response?

For example, the API call shows the below response:

        "stepGUID": "E1A4CDA7FA0011EBB4D53E2EFFAD6698",
        "stepName": "Success Log Message",
        "type": "STEP",
        "errorCount": "0",
        "warningCount": "0",
        "quite": "false",
        "startTime": "2021-09-21T18:40:06+0000",
        "endedState": "PASSED",
        "endedStateValue": "0",
        "stacktrace": null,
        "stepCommand": {
          "request": null,
          "requestBase64Encoded": null,
          "responseBase64Encoded": "true"

Expected plain text like below 

Test case ID = Rover
Test case Desc = SendAPI
Test case Severity = Critical


Release : 10.x

Component : DevTest API


Encoded response is by design.


By design, Lisa-Test-Invoke API returns Base64 Encoded response and there is no property which can be configured to get the plain text response. This is by design.

Below information will answer why the API responses are Base64 Encoded.

1.All our DEVTEST APIs return a JSON response
2. As per the JSON standard, any string that is not friendly to be wrapped inside the JSON should be Base64 encoded. This applies to Strings the contain any of the following special characters:
* - char - any Unicode character except " or \ or control character (ASCII < 20)* - \"* - \\* - \/* - \b* - \f* - \n* - \r* - \t* - \u0000
3. It doesn't matter if the String is valid XML or valid JSON itself. Any string that contains any of the special characters listed about cant be part of the JSON as it is. It either has to be escaped or Base64 Encoded. Escaping is very tedious for the consumer as they have to very very carefully un-escape it. The recommended practice, also the one that we follow is to Base 64 Encode it.
A JSON value cannot be part of the response of ANY Test Invoke API (http://localhost:1505/lisa-test-invoke/api/v1). The simple reason being the presence of double quotes " in the JSON string. As explained already, any request/response string in the TEST INVOKE API response which contains any of the following characters will be simply Base64 Encoded. Whenever we encode, we add flags to let the consumer understand that the value needs to be Base64 Decoded. (requestBase64Encoded, responseBase64Encoded). This is a standard practice. 
  • Backspace
  • Form feed 
  • Newline 
  • Carriage return 
  • Tab 
  • Double quote 
  • Backslash


Additional Information

If a plain text response is expected then write a wrapper to encode the Base64 response as a workaround.