How to handle REST API error (400) response payload in VBCS ?
I have a REST API that returns two different types of responses:
- Success scenario (HTTP 200):
Returns a JSON payload with the expected data. - Failed scenario (HTTP 400 – Bad Request):
Returns a different JSON payload that contains error information (example: error code, message, details).
In VBCS, while creating the Service Connection, I provided the success response JSON as the sample response schema. Because of this, the response structure generated in VBCS reflects only the success payload fields.
Problem:
When the API returns a 400 error, VBCS receives the response but I am unable to access or map the error-payload fields inside the Action Chain. The error JSON doesn’t match the success schema, so I can’t bind or display the error message to the user.